in reply to Opening Multiple FileHandles w/ Simpler Code
You can open them in a loop or map, filling an array or hash with references to the handles.
my @handles = map {FileHandle->new("> $_")} @filenames; $handles[3]->print( 'Message to the fourth handle.', $/); $_->print('Message to all handles', $/) for @handles;
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Opening Multiple FileHandles w/ Simpler Code
by Anonymous Monk on Aug 09, 2005 at 19:10 UTC | |
by tlm (Prior) on Aug 10, 2005 at 01:50 UTC |