for (@$ref) { print; $_ = undef; } # the [] array pointed to with the content of $ref is now [undef,undef]