From: Yitzchak Scott-Thoennes Date: Tue, 1 Oct 2002 09:54:30 +0000 (-0700) Subject: Re: [perl #17376] Bug Report - our(%) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c754c3d7d306f3634bb3500e77dcb37c2c9892e2;hp=d1573ac7f3669af3adf9935c83633459afbc51af;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #17376] Bug Report - our(%) Message-ID: p4raw-id: //depot/perl@17963 --- diff --git a/op.c b/op.c index 4804bf1..c7d085c 100644 --- a/op.c +++ b/op.c @@ -1680,7 +1680,7 @@ Perl_my_attrs(pTHX_ OP *o, OP *attrs) int maybe_scalar = 0; /* [perl #17376]: this appears to be premature, and results in code such as - C< my(%x); > executing in list mode rather than void mode */ + C< our(%x); > executing in list mode rather than void mode */ #if 0 if (o->op_flags & OPf_PARENS) list(o); diff --git a/pp_hot.c b/pp_hot.c index cc301ba..8d56ada 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -780,7 +780,7 @@ PP(pp_rv2av) } SP += maxarg; } - else { + else if (GIMME_V == G_SCALAR) { dTARGET; I32 maxarg = AvFILL(av) + 1; SETi(maxarg); diff --git a/t/comp/our.t b/t/comp/our.t index c381c41..8029f61 100644 --- a/t/comp/our.t +++ b/t/comp/our.t @@ -33,17 +33,18 @@ tie %x, 'TieAll'; {our $x;} is(TieAll->calls, '', 'our $x has no runtime effect'); + {our ($x);} is(TieAll->calls, '', 'our ($x) has no runtime effect'); + {our %x;} is(TieAll->calls, '', 'our %x has no runtime effect'); -{ - local $TODO = 'perl #17376'; - {our (%x);} - is(TieAll->calls, '', 'our (%x) has no runtime effect'); - {our @x;} - is(TieAll->calls, '', 'our @x has no runtime effect'); - {our (@x);} - is(TieAll->calls, '', 'our (@x) has no runtime effect'); -} +{our (%x);} +is(TieAll->calls, '', 'our (%x) has no runtime effect'); + +{our @x;} +is(TieAll->calls, '', 'our @x has no runtime effect'); + +{our (@x);} +is(TieAll->calls, '', 'our (@x) has no runtime effect');