> Hi all!
> 
> Can someone pls explain the problem here :
> 
> I am using MyModule.pm and the problem is coming as per i have explained 
> below
> 
> 
> MyModule.pm
> 
> package MyModule;
> 
> use strict;
> use Exporter;
> use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
> 
> $VERSION     = 1.00;
> @ISA         = qw(Exporter);
> @EXPORT      = ();
> @EXPORT_OK   = qw(&func1 &func2);
> %EXPORT_TAGS = ( DEFAULT => [qw(&func1)],
>                  Both    => [qw(&func1 &func2)]);

I believe DEFAULT is reserved and has a special meaning, aka that it
will export everything in @EXPORT which is cleared in your example. Try
using a different name, you could probably even use lowercase default if
you wanted to.

perldoc Exporter  specifically "Specialised Import Lists"

> 
> sub func1  { return reverse @_  }
> sub func2  { return map{ uc [EMAIL PROTECTED] }
> 
> 1;
> 
> 
> 
> 
> MyScript.pl (A simple script to use MyModule)
> 
> #!/usr/bin/perl -w
> 
> use strict;
> 
> # you may need to set @INC here (see below)
> 
> my @list = qw (J u s t ~ A n o t h e r ~ P e r l ~ H a c k e r !);
> 
> 
> # case 3
> use MyModule qw(:DEFAULT);
> print func1(@list),"\n";
> print func2(@list),"\n";
> 
> 
> Undefined subroutine &main::func1 called at test.pl line 22.
> 
> The ':DEFAULT' tag *should* export &func1 so you might expect the
error here 
> to concern a missing &func2. In fact Perl complains about &func1.
> 
> Looking forward for your responses...
> 
> Thanks in advance.
> 

HTH,

http://danconia.org


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to