![]() |
|
There's more than one way to do things | |
PerlMonks |
Re: Is a Dispatch Table appropriate here?by Belgarion (Chaplain) |
on Dec 14, 2005 at 05:38 UTC ( #516529=note: print w/replies, xml ) | Need Help?? |
Since your first line really wants a boolean, I would have changed your first line to something like:
If you're really looking for a dispatch table you could do something like:
Note: the above is completely untested. Update: I thought of another way of implementing this while in the shower. It does avoid the dispatch table, and it does set the correct variables based on the booleans. Still, it may not be easy to read for newer Perl developers.
In Section
Seekers of Perl Wisdom
|
|