in reply to Re: Re: Checking for "return undef"
in thread Checking for "return undef"

I know about the aliasing; I just assumed that the object passed was a shallow copy rather than the real McCoy.
  • Comment on Re: Re: Re: Checking for "return undef"

Replies are listed 'Best First'.
Re^4: Checking for "return undef" (changes)
by tye (Sage) on Apr 21, 2004 at 19:29 UTC

    I recall being surprised that $_[0] was a shallow copy and that assigning to $_[0] didn't change (the scalar holding) the object that invoked the method. I recall this being discussed in a node here (a while ago). I recall being surprised to hear the opposite (more recently but still at least weeks, probably months ago).

    So I think there used to be protections (perhaps unintentional) against modifying $_[0] in a method call and a while ago Perl changed in this regard.

    Sorry, I was unable to find hard references in the time allotted. I hope the wild rumors prove of some use anyway.

    - tye