# note: you could also do foreach my $d (0 .. $#arr_name) # on this loop my @Array_of_arrays; for (my $d =0; $d < $#arr_name; $d++) { # following line not necessary, but may help to # understand # what's going on: AoA[$d] is a reference to # an anonymous array $Array_of_arrays[$d] = []; # calculate the value $something2add, and push @{ $Array_of_arrays[$d] }, $something2add; } #### perl -e 'print "How sweet does a rose smell? "; chomp ($n = ); $rose = "smells sweet to degree $n"; *other_name = *rose; print "$other_name\n"'