note
Crackers2
<blockquote>
I did not suspect that the subroutine made a copy of the memory address
</blockquote>
<p>It doesn't. You do, with the <code>my($data) = @_;</code> snippet. If you directly manipulate the argument, it works as you expect:</p>
<code>
sub clear_it {
$_[0] = [];
}
</code>
<p>Because you're then working on the original reference, not on the copy <b>you</b> made.</p>
1207313
1207362