Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Missing $ on loop variable at measurements2.pl line 69.

by imp (Priest)
on Sep 08, 2006 at 12:42 UTC ( [id://571949]=note: print w/replies, xml ) Need Help??


in reply to Missing $ on loop variable at measurements2.pl line 69.

In this particular case it was easy for us to find the error, but in the future please only post the smallest segment of relevant code that still produces the error. Please read How (not) to ask a question - Only Post Relevant Code for an explanation.

If you aren't sure what code is relevant, start with the line number that was reported as having the error. The error message you reported said line 69, but when I run the code locally perl reports that the failure is on line 74 - which means the code provided is not the code that triggered the error.

Line 74 is:

for my ($counter=0;$counter<9;$counter++)
Which you could reduce to a minimal working example by just providing an empty loop body:
for my ($counter=0;$counter<9;$counter++) { }
Many times you will find that when you reduce the script to the smallest segment that still produces the error, the cause of the error becomes obvious.

Note that sometimes the reported line number is misleading, which is often the case when the issue is a missing (or extra) curly bracket, quote, or semi-colon. In those cases you need to iteratively reduce the code until the error no longer occurs, then backstep to see what block contained the error.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-18 04:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found