diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-30 12:58:16 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-30 12:58:16 +0000 |
commit | a01268b57212e226e8cd71d448590f3e6c10d529 (patch) | |
tree | d5af556152a0a5fb6a1171e857700ddebad98f1b /mg.c | |
parent | 5511f32566b97bafb11878d78796befdf490138c (diff) | |
download | perl-a01268b57212e226e8cd71d448590f3e6c10d529.tar.gz |
Add support for $^N, the most-recently closed group.
p4raw-id: //depot/perl@11038
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -435,6 +435,13 @@ Perl_magic_len(pTHX_ SV *sv, MAGIC *mg) goto getparen; } return 0; + case '\016': /* ^N */ + if (PL_curpm && (rx = PM_GETRE(PL_curpm))) { + paren = rx->lastcloseparen; + if (paren) + goto getparen; + } + return 0; case '`': if (PL_curpm && (rx = PM_GETRE(PL_curpm))) { if (rx->startp[0] != -1) { @@ -660,6 +667,14 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) } sv_setsv(sv,&PL_sv_undef); break; + case '\016': /* ^N */ + if (PL_curpm && (rx = PM_GETRE(PL_curpm))) { + paren = rx->lastcloseparen; + if (paren) + goto getparen; + } + sv_setsv(sv,&PL_sv_undef); + break; case '`': if (PL_curpm && (rx = PM_GETRE(PL_curpm))) { if ((s = rx->subbeg) && rx->startp[0] != -1) { |