I think this way is prettier.
sub do_something { my ($function) = @_; $function = 'default' unless exists $functions{$function}; $functions{$function}->(); }
Igor 'izut' Sutton
your code, your rules.
In reply to Re^4: What I Most Recently Learned in Perl, But Should Have Already Known
by izut
in thread What I Most Recently Learned in Perl, But Should Have Already Known
by liverpole
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |