summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1998-07-21 19:00:35 -0400
committerGurusamy Sarathy <gsar@cpan.org>1998-09-23 02:42:23 +0000
commit6cef1e77274f883a8b06f0546efeff6e6b8660d8 (patch)
treebf4b9e2bacfaee26c6b088c262fa38ed4b56dc8d /gv.c
parentaca2d49724bd7cda96bf319bce3078fc016f28f9 (diff)
downloadperl-6cef1e77274f883a8b06f0546efeff6e6b8660d8.tar.gz
support match indices via special variables @- and @+
Message-Id: <199807220300.XAA16081@monk.mps.ohio-state.edu> Subject: [PATCH 5.004_76] @- and @+ p4raw-id: //depot/perl@1800
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/gv.c b/gv.c
index 03b90c0fc1..a7e2b8091b 100644
--- a/gv.c
+++ b/gv.c
@@ -729,6 +729,14 @@ gv_fetchpv(char *nambeg, I32 add, I32 sv_type)
}
}
goto magicalize;
+ case '-':
+ if (len > 1)
+ break;
+ else {
+ AV* av = GvAVn(gv);
+ sv_magic((SV*)av, Nullsv, 'D', Nullch, 0);
+ }
+ goto magicalize;
case '#':
case '*':
if (ckWARN(WARN_DEPRECATED) && len == 1 && sv_type == SVt_PV)
@@ -738,7 +746,6 @@ gv_fetchpv(char *nambeg, I32 add, I32 sv_type)
case '^':
case '~':
case '=':
- case '-':
case '%':
case '.':
case '(':
@@ -763,8 +770,19 @@ gv_fetchpv(char *nambeg, I32 add, I32 sv_type)
if (len > 1)
break;
goto magicalize;
+ case '\023':
+ if (len > 1)
+ break;
+ goto ro_magicalize;
case '+':
+ if (len > 1)
+ break;
+ else {
+ AV* av = GvAVn(gv);
+ sv_magic((SV*)av, (SV*)av, 'D', Nullch, 0);
+ }
+ /* FALL THROUGH */
case '1':
case '2':
case '3':
@@ -774,7 +792,6 @@ gv_fetchpv(char *nambeg, I32 add, I32 sv_type)
case '7':
case '8':
case '9':
- case '\023':
ro_magicalize:
SvREADONLY_on(GvSV(gv));
magicalize: