in reply to Re: switch statement for subroutines?
in thread switch statement for subroutines?
I noticed you used the curley brackets instead of the regular brackets in the hash assignment, but that's okay ;)
I guess doing the following should be more readable, no?
This way we avoid most of the ugly punctuation marks.foreach ( @do_something ) { defined $subhash{$_} and $subhash{$_}->() } # OR foreach ( @do_something ) { $subhash{$_}->() if defined $subhash{$_} }
Aziz
|
|---|