All pastes #35290 Raw Edit

Stuff

public text v1 · immutable
#35290 ·published 2005-12-30 18:02 UTC
rendered paste body
I create a file under:  /usr/lib/perl5/site_perl/5.8.4/Foo/Utils.pm

it contains this:

package Foo::Utils;

require Exporter;
@ISA = qw(Exporter);

@EXPORT = qw(waa);
@EXPORT_OK = ('waa');

sub waa{
        print "waaaaa\n";
}

I check that it's okay like this:

chris@feodor:~$  perl -MFoo::Utils -e 1
chris@feodor:~$

So that looks okay. I then create a perl script like this:

#!/usr/bin/perl

use strict;
use Foo::Utils;

waa();


But it dies with:

Undefined subroutine &main::waa called at ./sendsms.pl line 7.


I can fix this by referencing the package directly like so: Foo::Utils::waa();  But isn't this what 'use Foo::Utils' is supposed to do for me??

What's my obvious mistake?