use Data::Dumper; my $ref = { "baz" => [1,2,3,4] }; print Dumper $ref; foo($ref); #$ref should be [1,2,3,4] now print Dumper $ref; sub foo { my $bar = shift; $bar = $bar->{baz}; #(1) #@$bar = @{$bar->{baz}}; #(2) print Dumper $bar; }