X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=gv.c;h=b04921894f46341f52450f2e81d898628e44215a;hb=5700b71cd8484a5485a9fb0bdde355ded1194121;hp=e4951a076df3233963d6d64219de8af93fd35a98;hpb=7fb3795116dd07b7f236652a03ac53946b1af7cf;p=p5sagit%2Fp5-mst-13.2.git diff --git a/gv.c b/gv.c index e4951a0..b049218 100644 --- a/gv.c +++ b/gv.c @@ -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: