P is for Practical | |
PerlMonks |
Re: Multi-stage flip-flop?by roboticus (Chancellor) |
on Dec 11, 2014 at 01:28 UTC ( [id://1110000]=note: print w/replies, xml ) | Need Help?? |
RonW: Here's an alternative, though the syntax isn't as nice as your proposed syntax:
Basically we're just using $fn to be a combination state variable / function pointer to track the current state of your chain of comparisons, and selecting a different handler at each match:
...roboticus When your only tool is a hammer, all problems look like your thumb.
In Section
Meditations
|
|