in reply to Grabbing unknown functions from modules

Personally, this sounds like a bad design to me. I would've built a function called getStruct() and pass it in A or B (or whatever). That function would then act as a dispatch table.

Or, if you really want to get the names (to loop through or whatever), I'd do the following:

package Struct::Stuff; use Exporter; our @ISA = qw(Exporter); our @EXPORT_OK = qw( %Struct_Dispatch ); my %Struct_Dispatch = ( A => \&__PACKAGE__::getAStruct, B => \&__PACKAGE__::getBStruct, # And so on ... ); sub getAStruct { } sub getBStruct { } ------- # In your main program ... use Struct::Stuff qw(%Struct_Dispatch); # Later ... foreach my $type (keys %Struct_Dispatch) { print "Doing '$type'\n"; my $val = $Struct_Dispatch{$type}->(); print "\tReturns '$val'\n"; }

If you build it right, there's no reason to loop through the symbol table or use some of the development modules. That stuff is black magic and most people don't know how to use them.

------
We are the carpenters and bricklayers of the Information Age.

The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.