From: Jarkko Hietaniemi Date: Thu, 29 Nov 2001 00:11:56 +0000 (+0000) Subject: [PATCH] Re: $\ very broken X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b2ce0fda3a46ec47a3c0b2c5696aaa867384eb2f;p=p5sagit%2Fp5-mst-13.2.git [PATCH] Re: $\ very broken From: Rafael Garcia-Suarez Date: Wed, 28 Nov 2001 22:33:08 +0100 Message-ID: <20011128223308.E732@rafael> Subject: Re: [PATCH] Re: $\ very broken From: Nicholas Clark Date: Wed, 28 Nov 2001 22:29:00 +0000 Message-ID: <20011128222859.K37621@plum.flirble.org> p4raw-id: //depot/perl@13345 --- diff --git a/mg.c b/mg.c index 6350690..84a63d0 100644 --- a/mg.c +++ b/mg.c @@ -781,6 +781,8 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) case ',': break; case '\\': + if (PL_ors_sv) + sv_setpv(sv,SvPVX(PL_ors_sv)); break; case '#': sv_setpv(sv,PL_ofmt); diff --git a/t/op/ref.t b/t/op/ref.t index 8ae9042..05f3b84 100755 --- a/t/op/ref.t +++ b/t/op/ref.t @@ -1,6 +1,8 @@ #!./perl -print "1..61\n"; +print "1..62\n"; + +require 'test.pl'; # Test glob operations. @@ -295,9 +297,22 @@ sub x::DESTROY {print "ok ", 54 + shift->[0], "\n"} } +my $result = runperl (switches=>['-l'], + prog=> 'print 1; print qq-*$\*-;print 1;'); +my $expect = "1\n*\n*\n1\n"; +if ($result eq $expect) { + print "ok 59\n"; +} else { + print "not ok 59\n"; + foreach ($expect, $result) { + s/\n/\\n/gs; + } + print "# expected \"$expect\", got \"$result\"\n"; +} + # test global destruction -my $test = 59; +my $test = 60; my $test1 = $test + 1; my $test2 = $test + 2;