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;
    }