in reply to Selecting text between given words (multi-lines (/n) and multiple occurrences)
open FH, "file.txt" or die "Couldn't open file.txt: $!"; while (<FH>) { if (/^begin:$/ .. /^end:$/) { print; # or do whatever else you want here. } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Selecting text between given words (multi-lines (/n) and multiple occurrences)
by nylon (Acolyte) on Aug 26, 2003 at 08:59 UTC |