Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Happy unbirthday redux! and other birthday stuff

by stevieb (Canon)
on May 18, 2017 at 15:06 UTC ( [id://1190539]=note: print w/replies, xml ) Need Help??


in reply to Re: Happy unbirthday redux! and other birthday stuff
in thread Happy unbirthday redux! and other birthday stuff

Nice effort.

I would highly recommend using @EXPORT_OK as opposed to @EXPORT. The latter forces the sub names into the caller's namespace. Even though you only have a single sub in most cases, it's still nicer to not pollute a namespace automatically:

our @EXPORT_OK = qw( sub_one sub_two sub_three ); our %EXPORT_TAGS; $EXPORT_TAGS{all} = [@EXPORT_OK];

Now, you can do:

use My::Module qw(sub_one sub_three);

...or even:

use My::Module qw(:all);

...which will import all @EXPORT_OK listed subs.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-25 05:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found