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

I must say that's rather an embarassing mistake but very nice catch, ++ to you. Thanks!
  • Comment on Re^2: Problems with sth->fetchrow array or another syntax error

Replies are listed 'Best First'.
Re^3: Problems with sth->fetchrow array or another syntax error
by GrandFather (Saint) on Aug 29, 2006 at 18:51 UTC

    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
Re^3: Problems with sth->fetchrow array or another syntax error (JSN)
by tye (Sage) on Aug 29, 2006 at 19:07 UTC

    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        

Re^3: Problems with sth->fetchrow array or another syntax error
by imp (Priest) on Aug 29, 2006 at 19:18 UTC
    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.