Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Answer: How can I create an array of filehandles?

by CharlesClarkson (Curate)
on Jun 11, 2001 at 09:35 UTC ( #87404=categorized answer: 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
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2020-11-27 00:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?