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
In reply to Re: Hash of output file handles
by thor
in thread Hash of output file handles
by graff
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |