open FH, "file.txt" or die "Couldn't open file.txt: $!"; while (<FH>) { if (/^begin:$/ .. /^end:$/) { print; # or do whatever else you want here. } }
In reply to Re: Selecting text between given words (multi-lines (/n) and multiple occurrences)
by Paladin
in thread Selecting text between given words (multi-lines (/n) and multiple occurrences)
by nylon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |