Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re^3: Pass array, then clearby Crackers2 (Parson) |
on Jan 16, 2018 at 18:27 UTC ( [id://1207364]=note: print w/replies, xml ) | Need Help?? |
I did not suspect that the subroutine made a copy of the memory address It doesn't. You do, with the my($data) = @_; snippet. If you directly manipulate the argument, it works as you expect:
Because you're then working on the original reference, not on the copy you made.
In Section
Seekers of Perl Wisdom
|
|