[OT] Perl woes

Abigail abigail at abigail.be
Wed Jan 28 13:52:07 GMT 2009


On Wed, Jan 28, 2009 at 12:30:20PM -0000, Jonathan Kimmitt wrote:
> Most people on this list seem to defend the perl design decision such
> that
> 
> if ($item == "xyzzy")
> 
> should only emit a warning, because after all, a string can be converted
> to a number with no loss of meaning (!).
> 
> However, what about this one:
> 
> for (my $i==0; $i<($tbl_width - 1); $i++) { .... }
> 
> Is anybody seriously arguing this could possibly do anything useful. Yet
> it
> is not trapped out as an error unless you add the obscure syntax:
> 
> use warnings FATAL => 'all';
> 
> to the beginning of your program.


But if you just enable warnings, you get a warning. At compile time.

  $ perl -wcE 'for (my $i==0; $i<($tbl_width - 1); $i++) {1;}'
  Useless use of numeric eq (==) in void context at -e line 1.
  $


Abigail


More information about the london.pm mailing list