Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
laziness, impatience, and hubris
 
PerlMonks  

Re: More Misleading Compiler Error Messages

by ikegami (Pope)
on Aug 01, 2006 at 23:17 UTC ( #565108=note: print w/ replies, xml ) Need Help??


in reply to More Misleading Compiler Error Messages

Might not be the only problem, but
1389: for my $i (0..@test_order-2])
should be
1389: for my $i (0..@test_order-2)


Comment on Re: More Misleading Compiler Error Messages
Select or Download Code
Re^2: More Misleading Compiler Error Messages
by QM (Vicar) on Aug 02, 2006 at 01:18 UTC
    Thanks. I should have said that I figured it out. I guess it was something of a puzzle as well.

    I just find it odd that the for loop expression didn't compile, and it's complaining about the my $i, which is bogus. Granted, it pointed out the syntax error, but syntax errors should trump warnings, shouldn't it?

    Thanks again!

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of

      You've obviously never driven your grandmother to the library, have you?

      GM: Look out for that bicycle! GM: Ooh! GM: The light is red, watch out! GM: Eek, a tram! Don't drive so fast! GM: Oh look what a darling kitty! Me: Where? GM: There! There behind that window, look! *CRASH*

      It doesn't realize the warning is related to the syntax error. Given

      my $s = shift . '!'; $s+++;

      the compile will issue both a warning (Warning: Use of "shift" without parens is ambiguous) and a syntax error (syntax error). As far as perl was concerned, it was the same situation with your code.

      Missing and extraneous closers (closing quotes, closing curlies, closing brackets, etc) are notoriously noisy errors. If you get a lot of unusual errors/warnings, chances are that's your problem.

        I see your point, though your example is lacking.

        Yes, $s+++ is a syntax error. However, the previous statement should be completely resolved before the syntax error is encountered. my $s = shift . '!'; is a complete statement.

        In my example, the syntax error causes the warning, even though the warning is bogus. Thereafter any statement using that variable also causes a warning. There seems to be some queue for warnings and error messages, and no particular priority.

        -QM
        --
        Quantum Mechanics: The dreams stuff is made of

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://565108]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (13)
As of 2014-04-24 12:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (565 votes), past polls