|
|
| No such thing as a small change | |
| PerlMonks |
Re^2: return if definedby Anonymous Monk |
| on Dec 20, 2012 at 13:11 UTC ( #1009742=note: print w/ replies, xml ) | Need Help?? |
|
Clever, but maybe a little too clever. This isn't the clearest construct in the world to begin with, and it especially has the potential to be confusing if the code within the do block is long. In that case, the last statement of the block is implicitly returned by the block and used as the return value, but it is a long way from the return statement itself. You could do the exact same thing a lot more clearly just by using a subroutine.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||