in reply to file merge problem

Havn't tested anything, but the first thing that comes to mind would be a loop to check for $3, $4, and so on, and stuff them into the hash as needed. something along the lines of:
if ($\$loop ne $NULL) { $hash1{$\$loop} = $\$loop+1 ; }
This assumes you define $loop and increment it twice.

Again, I didn't test, so I may be completely wrong with my thoughts, but this might get you going in the right direction. The loop would allow for as many posibilities as Perl hashes out in /(\w*) (\d*)/ ;