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:
sub clear_it { $_[0] = []; }
Because you're then working on the original reference, not on the copy you made.
In reply to Re^3: Pass array, then clear
by Crackers2
in thread Pass array, then clear
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |