c:\@Work\Perl\monks>perl -wMstrict -le "use 5.010; ;; print 'Perl version ', $]; ;; my $s = 'abcd'; ;; my @captures = $s =~ m{ (?= (\w\w)) }xmsg; printf qq{'$_' } for @captures; print ''; ;; local our @caps; ()= $s =~ m{ (?: (\w\w) (?{ push @caps, [ $^N, $-[1] ] }) (*F)) }xmsg; print qq{captured '$_->[0]' at offset $_->[1]} for @caps; " Perl version 5.014004 'ab' 'bc' 'cd' captured 'ab' at offset 0 captured 'bc' at offset 1 captured 'cd' at offset 2