When I try to use $fh{$record[0]} directly, perl complains about syntax errors. My work around works, but I somehow feel dirty afterwards. Is there something that I'm missing?my %fh; while(<>) { my @record = split; $fh{$record[0]} || open($fh{$record[0]}); my $fh = $fh{$record[0]}; print $fh $_; }
Thanks in advance,
thor
In reply to Hash values as filehandles by thor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |