sub foo { my ($ref) = @_; local *nonref = $ref; pop @nonref; print "@$ref\n"; pop @$ref; print "@nonref\n"; } foo([ 0 .. 9 ]);