Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Simple Module Tutorial

by chexmix (Hermit)
on Aug 12, 2008 at 13:24 UTC ( #703883=note: print w/replies, xml ) Need Help??


in reply to Simple Module Tutorial

I like this post very much, but the following is opaque to me for some reason:

"Case 3: The ':DEFAULT' tag *should* export &func1 so you might expect the error here to concern a missing &func2. In fact Perl complains about &func1. Hmm, what is going on here. The DEFAULT tag name is special and is automatically set in our modules %EXPORT_TAGS hash like this DEFAULT => \@EXPORT."

I confess I still don't know what is going on here, and am wondering if someone can help me out.

The words "is automatically set in our modules %EXPORT_TAGS hash like this DEFAULT => \@EXPORT" seem inaccurate to me, since when I look up at the code for MyModule.pm, I see the line

%EXPORT_TAGS = ( DEFAULT => qw(&func1),

and not the line

%EXPORT_TAGS = ( DEFAULT => \@EXPORT,

Is the OP saying that the line as is in the MyModule.pm code is incorrect, because the "special" nature of DEFAULT overrides it with something else?

Thanks. I feel I am blanking on something obvious here, but just can't see it this rainy morning.

Replies are listed 'Best First'.
Re^2: Simple Module Tutorial (DEFAULT)
by tye (Sage) on Aug 14, 2008 at 15:41 UTC
    Is the OP saying that the line as is in the MyModule.pm code is incorrect, because the "special" nature of DEFAULT overrides it with something else?

    Yes. Exporter.pm wants :DEFAULT to match @EXPORT so the module is incorrect in trying to define its own meaning for :DEFAULT. Based on what you've quoted, it appears that Exporter.pm forces this issue, but the more important point is that you shouldn't set $EXPORT_TAGS{DEFAULT} yourself.

    - tye        

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://703883]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2023-03-26 20:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (63 votes). Check out past polls.

    Notices?