So as we all suspected it was an end of line issue. What confuses me tho is why the semicolon didn't tell the interpreter that that was the end of the line...every other line is "improperly" ended, but the interpreter doesn't seem to care. I guess not all semicolons are created equal? UPDATE - I just re-read some of the previous posts, and I guess a semicolon in a comment is not created equal as it is rendered irrelevant by being in a comment...makes sense.

What happens when you run the program in the perl debugger?
Don't know how to do that yet

Are you using strict and warnings?
Not yet, but will start. Tried warnings a couple times, but got none, so moved on.
Had planned on using the shebang as well, but had to stop until I got this worked out. That's actually what tipped me off to the problem.

If that doesn't work, show us the output, inside <code> tags, of cat -e yourscript, or whatever the equivalent is on MacOS X. That should show any nonprinting...
I ran the cat -e, and it is in fact the ^M that seems to be in there munging it up.

However, the same script when created with vi ran just fine.
yea - I thought of this last night. I started doing my homework in BBedit just because it's a tool I am very used to for other work. I'll get out my little vi pocket ref and dig in...all the vi I ever knew will probably come back to me after a few scripts.

I do plan on trying to make it work the other way too tho. Many thanks to all who came to my rescue!

CTP

In reply to Re: Re: Comments trouble by ctp
in thread Comments trouble by Anonymous Monk

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.