develooper Front page | perl.perl5.porters | Postings from October 2008

Warning on abandoned statements?

Thread Next
From:
Peter Scott
Date:
October 30, 2008 14:57
Subject:
Warning on abandoned statements?
Message ID:
pan.2008.10.30.21.57.12.15627@PSDT.com
Is it (a) feasible, (b) desirable to issue a warning when a loop control
statement is an argument to a function that therefore will never be called?

E.g.:   print "Found it!", last if /wombat/;

That is perhaps the most plausible example and while the fix is obvious,
it seems deserving of a warning as much as use of a string in void
context, and for more or less the same reason.

-- 
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About