in reply to Varying Variable Names

It's almost never a good idea to create variable variable names. You have to turn off use strict and you'll very likely confuse yourself.

Use a complex data structure, like a hash of arrays or array of arrays. Well, you can't literally create a hash or array of arrays, but you can do a hash/array of array references, which makes things only a bit more complex. perldoc perlreftut is a good start for learning to use references (see also perldoc perlref and tye's references quick reference), but here's some skeleton code that uses the "array of arrays" method:

# 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; }

The idea is that, for each of the values $d loops over, $Array_of_arrays[$d] holds a reference to that array. by adding the @{} around that, you de-reference that value (i.e. get the array that it refers to).

Hope this gets you started.

perl -e 'print "How sweet does a rose smell? "; chomp ($n = <STDIN>); +$rose = "smells sweet to degree $n"; *other_name = *rose; print "$oth +er_name\n"'