The error refers to your use of
$i++ within the pattern match. If you really want to
do variable interpolation evaluate code within the pattern match, then you need to
enclose it with \Q\E, like so:
/<FN\Q$i++\E>(.+)\n/
...do something like this:
/<FN(?{$i++})(.+)\n/
Having said that, I sniff an
XY Problem here.
I'm really not sure what the purpose of that
$i++ is.
Is it some sort of counter, so that you know how many footnotes you have captured?
If that's the case, you could simply do something like this (untested):
while (<FILE>) {
chomp; #if necessary
if ($_ =~ m/<FN\d+>(.+)\n/) {
push @fnote, $1;
}
}
my $numfootnotes = scalar @fnote;
Hope this helps,
Darren :)