Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: More Misleading Compiler Error Messages

by ikegami (Pope)
on Aug 02, 2006 at 04:57 UTC ( #565155=note: print w/ replies, xml ) Need Help??


in reply to Re^2: More Misleading Compiler Error Messages
in thread More Misleading Compiler Error Messages

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.


Comment on Re^3: More Misleading Compiler Error Messages
Select or Download Code
Re^4: More Misleading Compiler Error Messages
by QM (Vicar) on Aug 02, 2006 at 14:23 UTC
    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

      The single statement $s+1 = shift . '!'; causes both a warning and an error usefully. That's the usual case.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (14)
As of 2014-10-24 16:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (132 votes), past polls