We don't bite newbies here... much | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I'd prefer not exporting anything unless the caller asked (look at the Exporter manual page). Note that (as far as I know) there are no (or few) modules in the core distribution that automatically export variables. For example, if I use File::Find I get find() shoved into my namespace, but still have to access $File::Find::name to get the full name. Likewise for $Data::Dumper::Purity and so on.
Remember that if they have to, your users can always use the fully-qualified name of your variable. But it's better to provide access to package data via a method, and even better to not export anything and use the OO interface. I often use modules and explicitly import nothing at all:
In reply to Re: should a module export FUNCTIONS or VARIABLES?
by bikeNomad
|
|