|
|
|
Clear questions and runnable code get the best and fastest answer |
|
| PerlMonks |
Re: improve ugly flow controlby FoxtrotUniform (Prior) |
| on Sep 19, 2004 at 03:53 UTC ( [id://392136]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
How about putting a "fail" sentinel at the end of @options and in %hash, such that do_something('fail') is the same as log_failure()? That way, your loop simplifies to: Now admittedly, inserting the sentinel into @options and %hash is obnoxious and hackish, but better to have that in your data than in your code.... --
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||