Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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 making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2018-07-19 17:43 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (413 votes). Check out past polls.