[Israel.pm] errors and warnings in Perl

Gabor Szabo szabgab at gmail.com
Tue Sep 11 00:20:41 PDT 2007


On 9/2/07, Shmuel Fomberg <semuelf at 012.net.il> wrote:
> Hello There.
>
> I don't think that there is any language that solved this problem. As much
> as I know, it's a bit of open problem, because the compiler can know that
> something is wrong only when it continues parsing and see that things are
> out of hand.
> Understanding the typical error messages is simply part of getting used to
> the language.

I am not about to solve *that* problem. That is much more difficult I guess.
My point is that sometimes the error messages themselves or at least
the explanations in diagnostics could be clearer.

One example the patch I sent in:

use strict;
$x = 23;

will complain that you have used  "use strict vars" ...

This does not make much sense for someone who is in her 2nd hour
into Perl programming and does not yet understand what use strict covers.

Most people don't understand that even after several years of Perl programming.
We can be glad if they solve the problem by sticking "my" in front of the $x
and not by putting # in front of use strict;....

So my grand advancement of the universe and world peace is to get
diagnostics print:
'You used either "use strict" or "use strict vars"....'

not much, I know, but I now I have my name in the Perl source code.
Yesh!

Gabor



More information about the Perl mailing list