in reply to about order in hash keys

How about
foreach my $key(sort keys %hash){......} #or numeric sort foreach my $key( sort {$a<=>$b} keys %hash){......}
if you want them in the exact insertion order
my $index=0; for(1..100){ $hash{$index}{'input1'} = $input1; $hash{$index}{'input2'} = $input2; #etc...... $index++; }
hashes are so flexible, you just need to figure out the scheme you need.

I'm not really a human, but I play one on earth. Cogito ergo sum a bum