in reply to return data from a subroutine reference...
$arch{$type}->("some stuff") simply calls the subroutine (see perlref), so you can capture the return value from it just as you would any other subroutine:
my $retval = $arch{$type}->("some stuff");
Update: You may also find Implementing Dispatch Tables helpful (from our Tutorials section).
|
|---|