in reply to Merging/Joining Multiple Large Files

Try to tie the large hash to a disk file. Your program should'nt need any changes.

(Except, perhaps, that scalar is unnecessary in

file_number > scalar( @{ $data{$key} } )
The numeric comparison already provides scalar context, so
file_number > @{ $data{$key} }
is equivalent.)

Anno