in reply to Re: syntactic sugar, hemlock, and other such fun
in thread syntactic sugar, hemlock, and other such fun
It sounds like you're trying to do some sort of dispatch table. So, just use a dispatch table.
This has an additional benefit of not mispelling anything.sub foo { print "Foo!\n"; } sub bar { print "Bar!\n"; } my %dispatch = ( foo => \&foo, bar => \&bar, ); for my $key (keys %dispatch) { print "$key ... "; &{$dispatch{$key}}; }
------
We are the carpenters and bricklayers of the Information Age.
Vote paco for President!
|
|---|