Steve Peters wrote:

On Wed, Apr 20, 2005 at 12:03:22PM -0500, David Nicol wrote:


in the thing I left the # out of, when it failed to parse, i got the
"failure near '){'"
message and then a series of reports about lexicals being out of scope,
on lines AFTER the error.

Maybe if perl had thrown on the error and then immediately shut up, I would not
have wasted so much time reviewing the wrong block. Now I'm taking it out
on the list? I believe I am not alone in this situation, and this
situation is the
kind of thing that drives people away from Perl.


I am wondering just how much time you blew looking at the wrong {BLOCK}.
If it were lots, your block is probably too big.  But thats just me.

Perl is not alone in this issue. C, COBOL, and Java all are capable of
generating error messages that make absolutely no sense to anyone but the compiler. The problem is that syntax errors are, by their nature,
impossible to predict and not every possible case could be thought up by
compiler designers.


see "Waterbed theory of complexity",
http://www.perl.com/pub/a/2003/06/25/perl6essentials.html


The warnings are not making guesses. That is simply the spot where it is
detected. So, are you saying it's Perl's fault if you accidently put
half of your program in a string and Perl only discovers this when you start a
new string?


Steve Peters
[EMAIL PROTECTED]



But perl is quite helpful with quoting errors, like the one youve posited.
And that was his point - its a big contrast.

What perl does know is the last thing it parsed correctly.
Everything afterwards is eligible for display to the user.
That said, less is more here, and more is clutter.
If its done, Id hope it would be optional, forex ' use pedantic '

<digression>
can options have an optional argument (in some universes) ?
Getopt::*::getopts doesnt allow that, either its ':' or its not.
If it were possible, then -w9 could be pedantic**2,
while -w is what the rest of us would use (until we got to a spot like David's, and we all will)
</>

Reply via email to