in reply to Re^2: How to copy a referenced data structure?
in thread How to copy a referenced data structure?

$copy = [ @$ar ];

$copy is a reference to an array. The first (and only) element of that array is the array that $ar refers to. When you undef $ar; that has no effect on the array that $ar referred to - and hence no effect on $copy.

Cheers,
Rob