http://www.perlmonks.org?node_id=1067671


in reply to create separate output files based on name

rruser:

Try using a hash table to hold your open file handles, using the company name as the key.

For each record, check whether you have an open file handle. If you do, then write the record. Otherwise open the file, store it in the hash, and then write the record.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

  • Comment on Re: create separate output files based on name