laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Your example problem is fairly simple, but for more complicated switch-like behavior,
It's way overkill for your particular problem, but for commplicated situations, @switch_foo can contain references to subs, making it quite powerful (if a little slow). In practice, however, if your algorithm needs a switch equivalent, you're better off re-thinking your algorithm. Update: fixed the code so that it works!
-- $me = rand($hacker{perl}); In reply to Re: fall through switch/case in perl
by radiantmatrix
|
|