|
|
| laziness, impatience, and hubris | |
| PerlMonks |
Re: Would you use 'goto' here?by Fletch (Chancellor) |
| on Dec 06, 2001 at 07:03 UTC ( #129841=note: print w/ replies, xml ) | Need Help?? |
|
You could always use a hash of coderefs to make a jump table.
Or if you've got a module, just call the apropriate method on it (if it can()).
Of course if you're going to get OOPy this would be something you could use a State/Strategy to represent the behavior (which reminds me I really should write a review of Design Patterns and Refactoring like I've been meaning to for a while now . . .).
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||