Help for this page

Select Code to Download


  1. or download this
    sub open_file {
            my ($mode, $file) = @_;
    ...
            open $fh, "$mode$file" or croak("could not open '$file': $!");
            return \*$fh;
    }
    
  2. or download this
    my $LOG = open_file('<','log.txt');
    while(<$LOG>) { print; }