I have a small question on the syntax of what the Camel book calls "here" documents. I have these lines of Perl...

$strSQL =<<END_SQL;
SELECT * FROM TABLE
END_SQL

Now if I place these against the left of the perl file, it works fine, but if I put a tab to move them over formatted in my if statement, perl gives me this...

Can't find string terminator "END_SQL" anywhere before EOF <BR
I just read in the Camel book the section on here document (page 66) and it states...

"The terminating string must appear by itself; unquoted and with no extra white space on either side, on the terminating side."

So, I'm assuming the tabs are why this is happening, but not sure if there's a way around it? I have some huge sql statements and it's a lot easier than putting the doublequotes and the formatting that I'd have to do if not using the <<END_SQL format. I'd rather not have to give up my formatting for this but if I have to it's worth it. Is there a way around this or is this the way it is?

Thanks in advance perlmonks.

In reply to here documents formatting by the_0ne

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.