You showed us an incomplete syntax. And given that you "cut and paste" your code, I wonder if you maybe failed to paste the entire syntax, just as you did in your example snippet here.

print << "THANKS"; Content-type: text/html
...is the beginning, and one line of a HERE document. But HERE docs must have an end tag. In the case of your code, everything from print << "THANKS"; on until you see THANKS a few lines later is all quoted material. If you didn't close your HERE doc, it could be runnning into the next THANKS tag, possibly where you copied and pasted this HERE-doc from.

Since your HERE doc is a double-quoted construct, variable interpolation occurs. And if your HERE doc is runaway, and subsequently closed with the closing token at some point later in the script, it's possible that variables which haven't yet been populated are being interpolated in your script.

Be sure to close your HERE docs, and if it is closed in your code, reflect that in your example snippets.

I should also mention that Perl's error reporting sees the entire multi-line HERE doc as all belonging to the line that contains the opening tag syntax. Hense, even if the problem is actually the fifth line of the HERE doc's text, the error will be reported as the line on which the opening tag is found. I hope this helps! Good luck.


Dave


In reply to Re: Concat Error, but I'm not concatenating?? by davido
in thread Concat Error, but I'm not concatenating?? by ecuguru

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.