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
In reply to Re: Parse a block of text
by Anonymous Monk
in thread Parse a block of text
by annie06
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |