in reply to CGI.pm HTML shortcuts
I like to keep control of the HTML that I write..
<AOL>Me too!</AOL>, but that being said, I never had been disappointed by the HTML output of CGI.pm. It's not as if you're using softwares like Dreamweaver, Frontpage or GoLive, which rely mostly on the inability of the user to actually write HTML, and thus output their own more or less mangled version of HTML.
CGI.pm on the other hand doesn't produce automatically HTML, you can mess up any way you want with the elements attributes (which is wrong), or put elements in the wrong places (TABLE tags in the HEAD, tags after the HTML ending, etc...). The big advantage of CGI.pm is to automatically generate valid XHTML, which is a Good Thing™.
For the speed question, everything comes at a price, and your process will use more resources to call the HTML tags from CGI than to simply print an interpolated string, but you usually doesn't have to worry about it as it is not a huge bottleneck (provided that you imported the html tags beforehand). If you already use CGI.pm in your script the overhead of generating the HTML is negligible, in my opinion.
If speed really matters, you should probably use mod_perl instead, with a Template-Toolkit handler. I have not tested this kind of configuration, but it should give quite good results
HTML Here-docs might be fine for small task, but if you have to generate tons of different pages with bazillions of different parameters for each, I'm not sure the guy who will eventually look up at your code later will appreciate that 4/5 of the program is embeded HTML with fragments of perl scattered all around...
<kbd>--
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: CGI.pm HTML shortcuts
by brpsss (Sexton) on Apr 19, 2001 at 23:24 UTC | |
by OeufMayo (Curate) on Apr 19, 2001 at 23:42 UTC | |
Re: Re: CGI.pm HTML shortcuts
by mpolo (Chaplain) on Apr 20, 2001 at 20:33 UTC | |
by tye (Sage) on Apr 20, 2001 at 20:44 UTC |