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"; }