in reply to Opening multiple output files within a loop

how can I generate a unique filehandle for each output file to then later use with print statements?

Store all the filehandles as values in a single hash which is keyed on the unique names (whether you use the actual filenames as keys or something symbolic is up to you). This way you can (a) pick a filehandle by key at any time and (b) iterate over all of them should the need arise.

  • Comment on Re: Opening multiple output files within a loop