diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1996-02-03 12:45:32 -0500 |
---|---|---|
committer | Andy Dougherty <doughera@lafcol.lafayette.edu> | 1996-02-03 12:45:32 -0500 |
commit | 464e2e8a8adc53c0c10661a188bbf62d0c83deeb (patch) | |
tree | 2f9785f2568727ca39d2ed4cb90948ff95b6186a /pp.c | |
parent | 6ec7a3cac15637f4da4fd51245a4366519e35a02 (diff) | |
download | perl-464e2e8a8adc53c0c10661a188bbf62d0c83deeb.tar.gz |
perl 5.002gamma: pp.c
>From salzench@dun.nielsen.comSat Feb 3 15:18:05 1996
>Date: Sat, 3 Feb 1996 12:45:32 -0500 (EST)
>From: Chip Salzenberg <salzench@dun.nielsen.com>
>Reply to: chip@atlantic.net
>To: Perl 5 Porters <perl5-porters@africa.nicoh.com>
>Subject: Beta3: Combine code: provide_refs
>From lwall@sems.comWed Feb 7 09:10:55 1996
>Date: Tue, 06 Feb 96 14:52:41 -0800
>From: Larry Wall <lwall@sems.com>
>To: perl5-porters@africa.nicoh.com
>Subject: study still busted
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 38 |
1 files changed, 19 insertions, 19 deletions
@@ -188,19 +188,8 @@ PP(pp_rv2sv) if (op->op_flags & OPf_MOD) { if (op->op_private & OPpLVAL_INTRO) sv = save_scalar((GV*)TOPs); - else if (op->op_private & (OPpDEREF_HV|OPpDEREF_AV)) { - if (SvGMAGICAL(sv)) - mg_get(sv); - if (!SvOK(sv)) { - if (SvREADONLY(sv)) - croak(no_modify); - (void)SvUPGRADE(sv, SVt_RV); - SvRV(sv) = (op->op_private & OPpDEREF_HV ? - (SV*)newHV() : (SV*)newAV()); - SvROK_on(sv); - SvSETMAGIC(sv); - } - } + else if (op->op_private & (OPpDEREF_HV|OPpDEREF_AV)) + provide_ref(op, sv); } SETs(sv); RETURN; @@ -433,6 +422,7 @@ PP(pp_study) } SvSCREAM_on(sv); + sv_magic(sv, Nullsv, 'g', Nullch, 0); /* piggyback on m//g magic */ retval = 1; ret: XPUSHs(sv_2mortal(newSViv((I32)retval))); @@ -1330,28 +1320,38 @@ PP(pp_hex) { dSP; dTARGET; char *tmps; + unsigned long value; I32 argtype; tmps = POPp; - XPUSHi( scan_hex(tmps, 99, &argtype) ); + value = scan_hex(tmps, 99, &argtype); + if ((IV)value >= 0) + XPUSHi(value); + else + XPUSHn(U_V(value)); RETURN; } PP(pp_oct) { dSP; dTARGET; - I32 value; + unsigned long value; I32 argtype; char *tmps; tmps = POPp; - while (*tmps && (isSPACE(*tmps) || *tmps == '0')) + while (*tmps && isSPACE(*tmps)) + tmps++; + if (*tmps == '0') tmps++; if (*tmps == 'x') - value = (I32)scan_hex(++tmps, 99, &argtype); + value = scan_hex(++tmps, 99, &argtype); else - value = (I32)scan_oct(tmps, 99, &argtype); - XPUSHi(value); + value = scan_oct(tmps, 99, &argtype); + if ((IV)value >= 0) + XPUSHi(value); + else + XPUSHn(U_V(value)); RETURN; } |