Ok, I just learned PERL, oh, two days ago so excuse me if this question sounds idiotic. I'm making a cgi script and recently I've come across a very annoying problem with the print <<SOMETAG; command. When I run the script with the -w command, I get an error saying that it can't find the string terminator before EOF. Well here's an example:
#!/usr/local/bin/perl print "Content-type:text/html\n\n"; print <<END; <html> <body> Bla bla bla </body> </html> END
When run I get the error: Can't find string terminator "END" anywhere before EOF at line 5. What's up with that? Why does it report EOF at line 5? I've used this print command before in other scripts with no problem and I can't figure out what the difference is between now and then. I've also got some scripts that use this print command several times and then the error is only reported with the last instance of the command. Is it just me or is this wierd? I don't know much about this language but I think that the above example should run fine.

In reply to Problems with print ID command by Dougie G

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.