in reply to Re: Multiple uses of (?{ code }) do not appear to be called
in thread Multiple uses of (?{ code }) do not appear to be called
Could that be explained by closures too? I am still examining the re 'debug' output.my @o; foo(); foo(); foo(); sub foo { my $window = "a b X20 c X5 d e X17 X12"; @::o = (); my @m = ($window =~ m/(X\d+(?{push @::o, pos()}))/g); print join(" ", "Matches:", @m, "\n"); print join(" ", "Offsets:", @::o, "\n\n"); }
|
|---|