Help for this page

Select Code to Download


  1. or download this
    open(my $fh, "<", $ARGV[0]) or die "\n$0 Error => $^E\n";
    my $data = do { local $/; <$fh> };
    close $fh;
    my @records = split /(?=\n\d+\s+)/, $data;
    # Now each item of @records has the lines you're looking for
    
  2. or download this
    open(my $fh, "<", $ARGV[0]) or die "\n$0 Error => $^E\n";
    my (@records,$rec);
    ...
    push @records, $rec if $rec;
    close $fh;
    # Now each item of @records has the lines you're looking for