|
Symbol::List - get a list of symbols that match a certain type |
Symbol::List - get a list of symbols that match a certain type
use Devel::GetSymbols qw(symbols subs);
my @subroutines = symbols('CODE');
my @subroutines = subs(); # equal
# @subroutines includes 'symbols', because it was imported
# into this package.
use Data::Dumper;
print "$_\n" for symbols('SCALAR', 'Data::Dumper');
use base 'Exporter';
@EXPORT_OK = symbols('CODE'); # Yuch.
@EXPORT_OK = subs(); # Ditto.
@EXPORT = grep /^[A-Z_]+$/, symbols('CODE'); # Export constants
This module just does a grep on some keys, but can save a lot of development time.
CODE
will be used most :)
symbols('CODE'). Does not take arguments (use symbols
if you want to get it from another package).
None yet
Juerd <juerd@juerd.nl>
|
Symbol::List - get a list of symbols that match a certain type |