in reply to defining a new var on the spot

Hotshot, others have explained why using symbolic references is a bad idea, here's an alternative:
my %hash_of_arrays; $tmp =~ /(.+)(\d+)$/; $hash_of_arrays{$1}->[$2] = $the_thing_to_store ; use Data::Dumper; print Dumper(\%hash_of_arrays);
hth, andy.

Update: dammit, davorg's already said that! I plead snow blindness.