in reply to Re: perldelta unclear on 'given's fate
in thread perldelta unclear on 'given's fate

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!!!

  • Comment on Re^2: perldelta unclear on 'given's fate