Change that to:
my %files; while ( <DATA> ) { next unless /^(\w+): (\d) (\w+)/; unless ( fileno $files{ $1 } ) { open $files{ $1 }, '>', "$1.tmp" or die "Couldn't open $1.txt. +..\n"; } print { $files{ $1 } } "$2 $3\n"; }
In reply to Re: hash element as file handle
by jwkrahn
in thread hash element as file handle
by halfcountplus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |