I'm not sure why you're using a dispatch table here :-)
There's no need for a hash if you're just running them in sequence anyway.sub tcid_1 { say 1 } sub tcid_2 { say 2 } sub tcid_3 { say 3 } sub tcid_4 { say 4 } my @tcids = 1..3; my @funcs = map { if (not exists &{"tcid_$_"}) { die "Invalid tcid: $_"; } \&{"tcid_$_"}; } @tcids; for my $f (@funcs) { $f->(); }
In reply to Re: "Dynamic" dispatch tables
by Tanktalus
in thread "Dynamic" dispatch tables
by elTriberium
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |