in reply to Parse a block of text
use warnings; use strict; my $START = qr{ \A Info [ ] I [ ] Want }xms; my $STOP = qr{ \A Start [ ] of [ ] Info [ ] I [ ] don't }xms; while (<DATA>) { if (/$START/ .. /$STOP/ xor /$STOP/) { print; } } __DATA__ asdfsdfds asdfasdf blah blah blah Info I Want I want this line And this line And this line this is the last line i want Start of Info I don't want blah blah blah blah blah
Output:
Info I Want I want this line And this line And this line this is the last line i want
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parse a block of text
by Anonymous Monk on Jul 07, 2008 at 20:46 UTC | |
|
Re^2: Parse a block of text
by Anonymous Monk on Jul 07, 2008 at 20:17 UTC |