Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: How can I create an array of filehandles?

by CharlesClarkson (Curate)
on Jun 11, 2001 at 09:35 UTC ( #87404=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    open my $fh, '>', $file_name or die "Cannot open $file_name: $!";
    
  2. or download this
    my %handles = get_write_handles(qw/col1.txt col2.txt col3.txt/);
    
    ...
      }
      return %file_handles;
    }
    
  3. or download this
    print { $handles{'in.txt'} } "something\n";
    
  4. or download this
    foreach (values %handles) {
      print $_ "something\n";
    }
    
  5. or download this
    sub get_read_handles {
      my @file_names = @_;
    ...
      }
      return @file_handles;
    }
    
  6. or download this
    sub get_append_handles {
      my @file_names = @_;
    ...
      }
      return @file_handles;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://87404]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2023-02-05 23:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (33 votes). Check out past polls.

    Notices?