From: Gurusamy Sarathy Date: Sun, 5 Mar 2000 16:54:10 +0000 (+0000) Subject: thinko in change#4546 that caused variables to lose their importedness X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=39bac7f7f5a36515e5edfd18fa0ae05b4fb933ec;p=p5sagit%2Fp5-mst-13.2.git thinko in change#4546 that caused variables to lose their importedness (GvIMPORTED_XV_off should be !GvIMPORTED_XV) p4raw-link: @4546 on //depot/perl: 11faa288e292c27cb2ddc4ccdc483b523d26ce19 p4raw-id: //depot/perl@5543 --- diff --git a/sv.c b/sv.c index f0fcfc0..8a86a92 100644 --- a/sv.c +++ b/sv.c @@ -2611,7 +2611,7 @@ Perl_sv_setsv(pTHX_ SV *dstr, register SV *sstr) else dref = (SV*)GvAV(dstr); GvAV(dstr) = (AV*)sref; - if (GvIMPORTED_AV_off(dstr) + if (!GvIMPORTED_AV(dstr) && CopSTASH_ne(PL_curcop, GvSTASH(dstr))) { GvIMPORTED_AV_on(dstr); @@ -2623,7 +2623,7 @@ Perl_sv_setsv(pTHX_ SV *dstr, register SV *sstr) else dref = (SV*)GvHV(dstr); GvHV(dstr) = (HV*)sref; - if (GvIMPORTED_HV_off(dstr) + if (!GvIMPORTED_HV(dstr) && CopSTASH_ne(PL_curcop, GvSTASH(dstr))) { GvIMPORTED_HV_on(dstr); @@ -2674,7 +2674,7 @@ Perl_sv_setsv(pTHX_ SV *dstr, register SV *sstr) GvASSUMECV_on(dstr); PL_sub_generation++; } - if (GvIMPORTED_CV_off(dstr) + if (!GvIMPORTED_CV(dstr) && CopSTASH_ne(PL_curcop, GvSTASH(dstr))) { GvIMPORTED_CV_on(dstr); @@ -2693,7 +2693,7 @@ Perl_sv_setsv(pTHX_ SV *dstr, register SV *sstr) else dref = (SV*)GvSV(dstr); GvSV(dstr) = sref; - if (GvIMPORTED_SV_off(dstr) + if (!GvIMPORTED_SV(dstr) && CopSTASH_ne(PL_curcop, GvSTASH(dstr))) { GvIMPORTED_SV_on(dstr); diff --git a/t/pragma/strict-vars b/t/pragma/strict-vars index 9352c4b..954d1e5 100644 --- a/t/pragma/strict-vars +++ b/t/pragma/strict-vars @@ -27,6 +27,15 @@ EXPECT # strict vars - no error use strict 'vars' ; use vars qw( $freddy) ; +BEGIN { *freddy = \$joe::shmoe; } +$freddy = 2 ; +EXPECT + +######## + +# strict vars - no error +use strict 'vars' ; +use vars qw( $freddy) ; local $abc::joe ; my $fred ; my $b = \$fred ;