Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Module/export problems

by PodMaster (Abbot)
on Jun 18, 2003 at 05:07 UTC ( #266730=note: print w/replies, xml ) Need Help??


in reply to Module/export problems

You're missing a ';' in the final example. In the above code you've shown, there is no sub Foo defined in package Mod;
package Mod; require Exporter; BEGIN { use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); %EXPORT_TAGS = (all => [qw(Foo Bar)]); @ISA = qw(Exporter); Exporter::export_ok_tags('all'); } sub Foo { die "I AM THE FOOO!!!" } package sorkeyso; BEGIN{ $INC{'Mod.pm'}=1} use Mod ':all'; Foo(); __END__ I AM THE FOOO!!! at - line 11.

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re: Re: Module/export problems
by jbeninger (Monk) on Jun 18, 2003 at 17:41 UTC
    Apologies - the semicolon and Foo() are both there in the actual code. The interesting part is that it succeeds when used by my other modules, just not in Mod::Sub, Mod::Sub2, etc. Is there any reason they wouldn't import like anything else, or should I be looking elsewhere?
      Do you get any errors? Are you useing the Mod.pm you think you are(check %INC)? Most likely you're not using the Mod.pm you think you are -- you didn't edit your Exporter.pm by any chance (you should check you're using the correct one as well)? There is nowhere else to look (unless you also use Mod::Blablah; which for some bizzare reason clobbers the %Mod::EXPORT_TAGS and other vars special to Exporter.pm -- bad).

      MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
      I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
      ** The third rule of perl club is a statement of fact: pod is sexy.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://266730]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2018-01-19 18:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (222 votes). Check out past polls.

    Notices?