Perl-Sensitive Sunglasses | |
PerlMonks |
Re^2: perldelta unclear on 'given's fateby morelenmir (Beadle) |
on Jan 04, 2014 at 18:45 UTC ( [id://1069309]=note: print w/replies, xml ) | Need Help?? |
Hmmm... I actually had to run that to work it out! It prints "one, two, three, three, three" because the 'three' routine resets the global $_ every time the flow of execution reaches it I think? But... why doesn't the same happen with the 'two ()' routine... Something to do with the parentheses - does that sub not effect the global $_? That's quite a mind-twister!!!
In Section
Seekers of Perl Wisdom
|
|