in reply to Re^4: Avoiding if/else knots II
in thread Avoiding if/else knots II
It looks good ;-) (to me). I read this as "switch for value ..."
Ah, style. Still, I deem it a misuse of for. It sets up the context of a loop whilst none needed.
This one looks better (for me, that is :-)
since a bare block does the job and is less clutter. And I also read it as "switch for $MyValue" ;-)# SWITCH { local $_ = $MyValue; /$reg2/ && do { sub_for_key_a(); last; }; /$reg1/ && do { whatever(); sub_for_key_b(); last; }; #default sub_for_default(); } # END SWITCH
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Avoiding if/else knots II
by Skeeve (Parson) on Aug 30, 2006 at 20:17 UTC |