in reply to Re: "return" to break out of a loop
in thread "return" to break out of a loop
For this to _really_ be nice, stuff like if would have to return the last value of the executed block:
Ordinary morality is for ordinary people. -- Aleister Crowley
We already have the ternary operator, but I find it can get hard to maintain when used often in one statement. Sparkling some do { .. }'s in only makes it a bit better.sub is_even { if (shift % 2) { 0 } else { 1 } }
Ordinary morality is for ordinary people. -- Aleister Crowley
|
---|
In Section
Seekers of Perl Wisdom