in reply to Changing items of an array in a function

Because you copied the referenced array's contents to a local copy and then modfied the local copy. You never copied it back. Try

use warnings; use strict; my @a = ("a", "b", "c"); Foo(\@a); print "$_ " foreach(@a); sub Foo { my $refA = shift; # my @b = @$refA; $refA->[0] = "hello"; $refA->[1] = "world"; $refA->[2] = "Perl"; }