http://qs1969.pair.com?node_id=567010

abachus has asked for the wisdom of the Perl Monks concerning the following question:

hello all,

I'd like to use something like the following code, but how does one get a return value from a call like that ?

my %arch=( apple => \&mac, sun => \&sparc, hp => \&parisc ); my $type='sun'; if(exists $arch{$type}) { $arch{$type}->("some stuff"); # Where / how to get the returned data ? } else { exit; } sub mac { return(0); } sub sparc { return(1); } sub parisc { return(2); }
thanks,

Isaac.