From: Robin Houston Date: Wed, 19 Dec 2001 13:48:55 +0000 (+0000) Subject: Re: [PATCH] ...while $var = glob(...) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ed2962a105a12c78ff0ebe49e6a9c5e59e9969d3;p=p5sagit%2Fp5-mst-13.2.git Re: [PATCH] ...while $var = glob(...) Message-ID: <20011219134855.A20452@puffinry.freeserve.co.uk> Not exactly a glob test but internal-logically correct. p4raw-id: //depot/perl@13800 --- diff --git a/t/op/glob.t b/t/op/glob.t index bc43323..079919d 100755 --- a/t/op/glob.t +++ b/t/op/glob.t @@ -5,7 +5,7 @@ BEGIN { @INC = '../lib'; } -print "1..8\n"; +print "1..9\n"; @oops = @ops = ; @@ -58,3 +58,10 @@ print $i == 2 ? "ok 7\n" : "not ok 7\n"; my $ok = "not ok 8\n"; $ok = "ok 8\n" while my $var = glob("0"); print $ok; + +# The formerly-broken test for the situation above would accidentally +# test definedness for an assignment with a LOGOP on the right: +my $f=0; +$ok="ok 9\n"; +$ok="not ok 9\n", undef $f while $x = $f||$f; +print $ok