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

Warning on abandoned statements?

Thread Next
Peter Scott
October 30, 2008 14:57
Warning on abandoned statements?
Message ID:
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

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About