Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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.


In reply to Re: Missing $ on loop variable at measurements2.pl line 69. by imp
in thread Missing $ on loop variable at measurements2.pl line 69. by Yoda_Oz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-29 09:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found