Hi monks!
For some reason, I want to open several files for write, and seek those output handles by their name:
my %handles; while (<IN>) { my $file_out = get_the_way_out($_); my @some_data = get_the_data($_); if (!exists $handles{$file_out}) { open my $handle,'>',$file_out or die $!; $handles{$file_out} = $handle; } # but this is not allowed say $handles{$file_out} join "\t",@some_data; } close $_ foreach values %handles;
How can I properly organize my handles? Thanks for a lot!
In reply to store file handles in a hash by llancet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |