in reply to Exporter question
Here's some code adapted from my Sub::Approx module which builds a list of all of the subroutines in a given package:
foreach (keys %{"${pkg}::"}) { my $glob = $::{$_}; $glob =~ s/^\*${pkg}:://; next unless defined &{"*${pkg}::$glob"}; push @subs, $glob; }
I guess it would be possible to run code like this in a BEGIN block and build up your @EXPORT array that way.
Update As tilly points out below, when a BEGIN block is executed none of the package's subroutines will have been defined. Therefore you should just put this code in the body of your package.
--
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE (tilly) 2: Exporter question
by tilly (Archbishop) on Aug 24, 2000 at 14:36 UTC |