You can use (?{...}) (see perreref's EXTENDED CONSTRUCTS) to execute a code fragment inside a regex so:
while (<IN>) { if (m/^\d+\sof\s\d+\sDOCUMENTS$/mx ... m/^No.\s\w+$/mx){ $casename = $1 if /^(.*)/; /EDUCATION(?{$count++})/g; } }
would seem to do what you want.
In reply to Re: Capture/Counting text between patterns across multiple lines
by GrandFather
in thread Capture/Counting text between patterns across multiple lines
by micwood
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |