From: Nicholas Clark Date: Sun, 27 Apr 2008 09:21:45 +0000 (+0000) Subject: Warnings within the condition of while are not reported with the X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=798518689d64e9ab055d8782c5c39291ab450b14;p=p5sagit%2Fp5-mst-13.2.git Warnings within the condition of while are not reported with the correct line number. TODO test inspired by code from Bram. p4raw-id: //depot/perl@33756 --- diff --git a/t/lib/warnings/9uninit b/t/lib/warnings/9uninit index 570290a..b1c2a4f 100644 --- a/t/lib/warnings/9uninit +++ b/t/lib/warnings/9uninit @@ -1332,6 +1332,22 @@ EXPECT Use of uninitialized value $undef in numeric eq (==) at - line 4. Use of uninitialized value $undef in numeric eq (==) at - line 5. ######## +# TODO long standing bug - conditions of while loops +use warnings; + +my $c; +my $d = 1; +while ($c == 0 && $d) { + # a + # few + # blank + # lines + undef $d; +} +EXPECT +Use of uninitialized value $c in numeric eq (==) at - line 5. +Use of uninitialized value $c in numeric eq (==) at - line 5. +######## # TODO long standing bug - more general variant of the above problem use warnings; my $undef;