You can simplify this: map { close $handle{$_} } keys %handle; to close $_ for values %handle;
The start of some sanity?
In reply to Re^2: Write to multiple files by BrowserUk in thread Write to multiple files by julio_514