in reply to Problems with sth->fetchrow array or another syntax error

Your first heredoc is
print <<" EOF"; ... END

Replies are listed 'Best First'.
Re^2: Problems with sth->fetchrow array or another syntax error
by coldfingertips (Pilgrim) on Aug 29, 2006 at 17:00 UTC
    I must say that's rather an embarassing mistake but very nice catch, ++ to you. Thanks!

      That is a problem that I pick up as I enter the code into the editor I use with Perl. It is syntax savy and grumbles until I close here docs correctly. It also grumbles about other similar gratuitous syntax fauxpars. Having a Perl syntax savy editor is a great bacon saver!


      DWIM is Perl's answer to Gödel

      I stopped using here-docs long ago. qq[ ... ] and similar span lines easily and have other advantages (and some fairly minor disadvantages) but have the significant advantage of not failing in the face of trailing whitespace. Trailing whitespace should never matter, and so here-docs are unacceptably fragile to me. The problems with leading spaces and simple misspelling of the terminator so easily resulting in quite confusing error messages are also good reasons to avoid them. :)

      - tye        

      Happy to help.

      Part of the problem you had in diagnosing the problem was because the source code was hard to parse at a glance, which tends to happen when HTML and perl are in the same context.

      I recommend splitting the HTML into a template and using one of the many templating systems that are available. Everyone has their favorite (my favorite is Template Toolkit), but for a first effort I would recommend HTML::Template. You can learn the syntax and be up and running within 30 minutes generally.