[OT] Perl woes
Philippe Bruhat (BooK)
philippe.bruhat at free.fr
Wed Jan 28 12:52:35 GMT 2009
On Wed, Jan 28, 2009 at 12:30:20PM -0000, Jonathan Kimmitt wrote:
>
> 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:
This is a different issue: it's not == vs. eq any more, but == vs. =.
And I'd do it like this:
foreach my $i ( 0 .. $tbl_width - 2 ) { ... }
No more naughty comparison operators to misinterpret my data!
--
Philippe Bruhat (BooK)
Some fair deals are fairer than others.
(Moral from Groo The Wanderer #101 (Epic))
More information about the london.pm
mailing list