in reply to $+ versus $^N
The difference is that $^N contains the last closed capture while $+ contains the last opened one. That is, $^N looks to right parens and $+ to left ones. That makes a difference for nested captures.
From the command line in 5.8.0:
$ perl -e'$_=foobar;/(oo(ba)r)/;print $+,$/' ba $ perl -e'$_=foobar;/(oo(ba)r)/;print $^N,$/' oobar $
After Compline,
Zaxo
|
|---|