Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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

by stevieb (Canon)
on May 18, 2017 at 15:06 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2019-09-16 04:09 GMT
Find Nodes?
    Voting Booth?
    The room is dark, and your next move is ...

    Results (185 votes). Check out past polls.