Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: HTML In CGI Scripts.

by Cody Pendant (Prior)
on Jul 10, 2003 at 06:23 UTC ( #272904=note: print w/replies, xml ) Need Help??


in reply to HTML In CGI Scripts.

The real point, as so many people have said, is that if it's only you, and it's working, then who cares? The moment you've got designer(s) working on the HTML or similar workflow issues, you've got trouble.

I get the impression that the from-worst-scenario-to-best progression in Perl/HTML interaction is like this:

  1. Using hundreds of horrible print statements, all of which neeed to have all the quotes escaped
  2. Using "print qq" instead
  3. Using HERE documents or subs
  4. Using your own templating system
  5. Throwing your own templating system away and using HTML::Template

Signed,
Nearly Ready To Move To Stage 5



“Every bit of code is either naturally related to the problem at hand, or else it's an accidental side effect of the fact that you happened to solve the problem using a digital computer.”
M-J D

Replies are listed 'Best First'.
Re: Re: HTML In CGI Scripts.
by Trimbach (Curate) on Jul 10, 2003 at 14:37 UTC
    To your list I'd add:

      3.5.   Print using CGI.pm's HTML generation

    Each method (well, except for #1. Yech.) has it's place, and they all work, but I think you've definitely captured the evolutionary aspect of this topic. :-)

    Gary Blackburn
    Trained Killer

      You're right of course. I realised that later.

      But looked at another way, it's almost on its own list. It doesn't mix HTML and Perl at all. You get purity at the expense of no longer being able to see your HTML as HTML.

      Mind you, somewhere recently, Merlyn posted (boasted) about his script which reversed the process and turned HTML into CGI.pm data structures.

      Can anyone come up with that link? It's certainly an intriguing Third Way of approaching workflow -- get your designers to come up with HTML, slurp it into CGI.pm, then throw it away? Given valid code it's not unreasonable... Hmmm...



      “Every bit of code is either naturally related to the problem at hand, or else it's an accidental side effect of the fact that you happened to solve the problem using a digital computer.”
      M-J D

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://272904]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2023-10-04 17:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?