|
|
| Pathologically Eclectic Rubbish Lister | |
| PerlMonks |
Re: Perl: last evaluated value as a returned value for a subroutine. See insideby LanX (Monsignor) |
| on Feb 21, 2013 at 17:00 UTC ( #1019983=note: print w/ replies, xml ) | Need Help?? |
|
EDIT: now I get it, the sub returns the evaluation from the unless-condition in the first line. ... WTF ... You like obfuscation, don't you? > are there any conditions when Perl would NOT print "some string" in last two lines of code sure if you set $R to anything false ( EDIT:... it will start from new, otherwise it will print the new value.) if you wanna avoid that anyone ever unintentionally changes $R, then put the whole closure construct into braces and $R is out of scope for any other code.
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||