All you need to do is to build your @EXPORT array dynamically after defining all of your functions.
--use strict; package MyModule; use vars qw(@ISA @EXPORT); require Exporter; @ISA = qw(Exporter); sub test { print "In test\n" }; sub test_again { print "In test_again\n" }; sub last_test{ print "In last_test\n" }; while (my ($name, $glob) = each %MyModule::) { push @EXPORT, $name if defined *$glob{CODE}; } 1;
"The first rule of Perl club is you don't talk about Perl club."
In reply to Re: Export all subs from a module
by davorg
in thread Export all subs from a module
by andye
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |