in reply to Call to subs in a Dispatch Table
You should wrap the calls to your subroutines inside the SAME anonymous sub, like so:
use strict; use warnings; use Data::Dumper; sub info { print Dumper \@_ }; sub names { print Dumper \@_ }; my %general = ( data => sub { info( who => 'data who', why => 'data why', ) }, results => sub { names( first => 'results first', zip => 'results zip', ); info( who => 'results who', why => 'results why', ); }, ); $general{data}->(); $general{results}->();
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|