I think that is a common practice in Perl. I always write code like this:
my %functions = ( 'this' => sub { ... }, 'that' => \&do_something, ); my %attrs = (...); my $key = 'this'; $functions{$this}->(\%attrs);
Hope this helps.
Igor 'izut' Sutton
your code, your rules.
In reply to Re: Avoiding if/else knots
by izut
in thread Avoiding if/else knots
by loris
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |