[OT] Perl woes

Mark Blackman mark at blackmans.org
Wed Jan 28 14:04:30 GMT 2009


On 28 Jan 2009, at 12:26, Jonathan Stowe wrote:

> 2009/1/28 Mark Blackman <mark at blackmans.org>:
>>
>> On 28 Jan 2009, at 12:01, Paul Makepeace wrote:
>>>
>>> Can you give an example where perl is doing something surprising  
>>> to you?
>>
>> perl -le 'print "yes" if "a" == "b"'
>>
>> Is the kind of case I suspect he's hit.
>
>
> I guess that "non-number used in a numeric or arithmetic context is
> treated as 0" isn't at all obvious to the beginner.  We tend to think
> that DWIM is one of the strengths of Perl, but someone not coming from
> a Perl background is likely to have a totally different value of
> "WIM" than that catered for by Perl :-)

Indeed, although the point is made pretty early on in 'man perldata'
under 'Scalar Values' and is inherited from 'awk' apparently.

I certainly read and re-read both perldata and perlsyn quite a lot
when I started using Perl.

- Mark


More information about the london.pm mailing list