Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^5: How come @_ gets changed here?

by dave_the_m (Prior)
on Jun 10, 2017 at 19:04 UTC ( #1192487=note: print w/replies, xml ) Need Help??

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.


Replies are listed 'Best First'.
Re^6: How come @_ gets changed here?
by LanX (Bishop) 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!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1192487]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2018-01-24 00:45 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (254 votes). Check out past polls.