Help for this page

Select Code to Download


  1. or download this
    open(FILE, "<x.log");
    my @array = <FILE>;  # no need to use memory that way
                         # a lot of the input line will be
                         # thrown away
    close(FILE);
    
  2. or download this
    open(FILE, "<", "x.log") or die "unable to open x.log $!";
    while my $line (<FILE>)
    ...
       ... process each $line...
    
    }