|
|
|
good chemistry is complicated, and a little bit messy -LW |
|
| PerlMonks |
Re^3: how to loopby cbrandtbuffalo (Deacon) |
| on Feb 21, 2007 at 15:00 UTC ( [id://601346]=note: print w/replies, xml ) | Need Help?? |
|
From a maintenance perspective, I like the previous example a bit more because you can understand the exit condition by reading the while line. Even a non-coder could understand it: while ($mode eq 'running'); keep going while the mode equals 'running'. In your example, I have to search through the entire block and find the 'last if' line to figure out how you break out of the loop. They are basically equal, but I find the first example easier to read and understand.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||