in reply to Re: optimized switch case
in thread optimized switch case
# Or more maintainable! %options=( a => sub { do_this() or that() }, b => \&do_that, c => sub { do_nut() }, ); foreach(split(//, &fetch_input)) { &{$options{$_}} if exists $options{$_}; }
|
|---|