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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.