From: Hugo van der Sanden Date: Thu, 4 Feb 1999 02:37:31 +0000 (+0000) Subject: Re: .. misinterpreted as flipflop X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=86cb71737ed277fd6cd123008b871f7a00c2944b;p=p5sagit%2Fp5-mst-13.2.git Re: .. misinterpreted as flipflop Message-Id: <199902040237.CAA03255@crypt.compulink.co.uk> p4raw-id: //depot/perl@2923 --- diff --git a/pp_ctl.c b/pp_ctl.c index 2f66a5f..52fcf96 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -1069,6 +1069,11 @@ PP(pp_flop) register SV *sv; I32 max; + if (SvGMAGICAL(left)) + mg_get(left); + if (SvGMAGICAL(right)) + mg_get(right); + if (SvNIOKp(left) || !SvPOKp(left) || (looks_like_number(left) && *SvPVX(left) != '0') ) { diff --git a/t/op/range.t b/t/op/range.t index 01f5f70..1698db4 100755 --- a/t/op/range.t +++ b/t/op/range.t @@ -1,6 +1,6 @@ #!./perl -print "1..12\n"; +print "1..13\n"; print join(':',1..5) eq '1:2:3:4:5' ? "ok 1\n" : "not ok 1\n"; @@ -55,3 +55,12 @@ print "ok 11\n"; print "not " unless "@a" eq "-2147483647 -2147483646"; print "ok 12\n"; +# check magic +{ + my $bad = 0; + local $SIG{'__WARN__'} = sub { $bad = 1 }; + my $x = 'a-e'; + $x =~ s/(\w)-(\w)/join ':', $1 .. $2/e; + $bad = 1 unless $x eq 'a:b:c:d:e'; + print $bad ? "not ok 13\n" : "ok 13\n"; +}