And it's documented in perlre#(?{-code-}), right where it's supposed to be.
Inside a (?{...}) block, $_ refers to the string the regular expression is matching against. You can also use pos() to know what is the current position of matching within this string.
The solution is simple, use an explicit loop variable:
for my $d (@dat){ push (my @u, [$d->[0], $d->[1]]); ...
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re: Can't do dereference when running code inserted inside regex
by LanX
in thread Can't do dereference when running code inserted inside regex
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |