in reply to Re: switch statement for subroutines?
in thread switch statement for subroutines?

Hello,

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?

foreach ( @do_something ) { defined $subhash{$_} and $subhash{$_}->() } # OR foreach ( @do_something ) { $subhash{$_}->() if defined $subhash{$_} }
This way we avoid most of the ugly punctuation marks.

Aziz