Help for this page

Select Code to Download


  1. or download this
    sub read_n_lines
    {
        my ($fh, $count) = @_;
    ...
        $buffer .= $_ for 1 .. $count;
        return $buffer;
    }
    
  2. or download this
    open(my $handle, 'c:/file.log') or die "Can't read file: $!\n";
    
    while(not eof( $handle ))
    ...
        my $parsed = parse_chunk( $chunk );
        print_parsed( $parsed );
    }