diff options
author | Jeff Pinyan <japhy@pobox.com> | 2001-07-16 14:46:53 -0400 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-07-17 07:57:06 +0000 |
commit | e521374caf664d14b86b1eb0931fa32b77c9367f (patch) | |
tree | 41eceff6d0d4cced0852ad40c2a6d5135f349eed /gv.c | |
parent | 8ff9412f9ef1dbdabee4f0993653e1446d7a88c8 (diff) | |
download | perl-e521374caf664d14b86b1eb0931fa32b77c9367f.tar.gz |
Re: [PATCH gv.c] allow ${"1f"} to be non-regex var
Message-Id: <Pine.GSO.4.21.0107161829390.1405-100000@crusoe.crusoe.net>
p4raw-id: //depot/perl@11394
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -938,6 +938,17 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type) case '7': case '8': case '9': + /* ensures variable is only digits */ + /* ${"1foo"} fails this test (and is thus writeable) */ + /* added by japhy, but borrowed from is_gv_magical */ + + if (len > 1) { + const char *end = name + len; + while (--end > name) { + if (!isDIGIT(*end)) return gv; + } + } + ro_magicalize: SvREADONLY_on(GvSV(gv)); magicalize: |