in reply to Re^4: How come @_ gets changed here?
in thread How come @_ gets changed here?

the rough rule is: don't free elements of arrays and hashes (e.g. by assigning a list to the array or hash) when those elements are currently the arguments of a funtion call, or are being iterated over by for(), etc.

Dave.

Replies are listed 'Best First'.
Re^6: How come @_ gets changed here?
by LanX (Saint) on Jun 10, 2017 at 19:16 UTC
    Please correct me if I'm wrong, but as long as I copy the args in my first line, it should be safe from messed up ref counts, shouldn't it?

    my ($a, $b) = @_

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!