in reply to Re: Syntax error? I don't think so...
in thread Syntax error? I don't think so...

George_Sherston is absolutely right, I would say take it one step further. Check out Mason, HTML::Template or Template Toolkit.

These allow you to remove your markup and design from your code and stick them into a template.

This provides you with some distinct advantages:

You avoid mistakes like the one you ran into

You gain many of the advantages of frames (factoring out repeated elements in your markup) with out the problems associated with frames (i.e. javascript across secure frames, SSL lock not showing if just the inner frame is SSL)

It is more maintainable and easier to read. Do not take this lightly. I have had the unfortunate responsiblilty of maintaining code that had HTML and SQL in HEREDOCS. Trying to read through code with bad indentation because of HEREDOCS will make your head spin. Imagine if you will buried in 60-70 line of HTML 3 lines that loop are your logic for displaing a table :(


I personally lean towards Template Toolkit because of the fact it can template more than HTML, but all of them are fine choices



grep
Unix - where you can thrown the manual on the keyboard and get a command
  • Comment on Re: Re: Syntax error? I don't think so...

Replies are listed 'Best First'.
Re: Re: Re: Syntax error? I don't think so...
by ninja-joe (Monk) on Apr 29, 2002 at 15:15 UTC
    I would have used that HTML::Template module if my script didn't have to hang out on Hostway's servers. Their unix shell account doesn't have the HTML::Template module installed. :-(
      Just an FYI, if you have a home dir I believe you can install it under it. Check out perl.com and look for installing mod_perl without root privilege. It's not the same, but the concept is. Hope this helps.