in reply to $+ versus $^N

Here is some code to show the difference (perlvar as you quoted gives a good description):
use strict; use warnings; my $plus; my $N; my $text = "abc123def"; my $text_match = qr/((\D+)(\d+))(?{ $plus = $+;$N = $^N })(\D+)/; $text =~ $text_match; print "$plus, $N\n"; $text_match = qr/(\D+)(\d+)(?{ $plus = $+;$N = $^N })(\D+)/; $text =~ $text_match; print "$plus, $N\n";

update:oh yeah the results:

__END__ 123, abc123 123, 123
-enlil

Replies are listed 'Best First'.
Re: Re: $+ versus $^N
by diotalevi (Canon) on Apr 16, 2003 at 13:09 UTC

    The description may have been good but I wasn't up to the task of noticing the difference. Thank you all for clarifying this.