in reply to How to parse this information out?

Hello coltman, how about this:

$\ = "\n"; # always print a newline at the end while (<>) { @s = split /\s{3,}/; # split the input into phrases print grep /NOTICE/, @s; # print the matching phrases }

Regards
~ Sixtease

Replies are listed 'Best First'.
Re^2: How to parse this information out?
by kyle (Abbot) on Mar 21, 2007 at 21:28 UTC

    This prints an extra blank line for every input line that does not match. Taking a cue from Anno's solution, you could fix this by inserting a for. You also get an extra newline where there's a matching phrase on a line by itself. Fix with chomp.

    $\="\n"; while (<>) { chomp; @s=split /\s{3,}/; # split the input into phrases print for grep /NOTICE/, @s; # print the matches }