Perl: the Markov chain saw | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
This snippet updates @EXPORT so that all of your defined functions in the current package are exported.
Do not execute this in a BEGIN block, or it'll be too early. You want to let the compiler first read the whole file first, then execute this code on the run pass. Consider also using @EXPORT_OK instead of @EXPORT, so that your list of exported functions doesn't accidentally change. Also, you can add more restrictions to the grep to exclude functions that begin with an underscore, for example.
upate: changed "defined" to "exists" after much discussion. In reply to Automatically add all defined functions to your @EXPORT by merlyn
|
|