#! perl use strict; use warnings; use Data::Dumper; my @list = qw(abc def); my $nelts = 3; print "\nCase 1:\n"; my @array1 = (copy(\@list)) x $nelts; $array1[0][0] = 'xyz'; $array1[0][1] = '123'; print Dumper(\@array1); print "\nCase 2:\n"; my @array2 = map { copy(\@list) } 1 .. $nelts; $array2[0][0] = 'uvw'; $array2[0][1] = '456'; print Dumper(\@array2); sub copy { my ($list_ref) = @_; print "call copy($list_ref)\n"; my @clone = @$list_ref; return \@clone; } #### 13:51 >perl 888_SoPW.pl Case 1: call copy(ARRAY(0x1c7dec8)) $VAR1 = [ [ 'xyz', '123' ], $VAR1->[0], $VAR1->[0] ]; Case 2: call copy(ARRAY(0x1c7dec8)) call copy(ARRAY(0x1c7dec8)) call copy(ARRAY(0x1c7dec8)) $VAR1 = [ [ 'uvw', '456' ], [ 'abc', 'def' ], [ 'abc', 'def' ] ]; 13:51 >