in reply to Hash of output file handles

This sort of thing becomes immensely useful when you create your files "on the fly". A contrived example is in order:
use strict; use warnings; my %fh; foreach (1..1000) { my $num = int(rand() * 10000); my $first_char = substr($num, 0, 1); $fh{$first_char} || open($fh{$first_char}, ">$first_char.out") or die $!; print {$fh{$first_char}} "$num\n"; }

thor