Welcome to the Monastery | |
PerlMonks |
Re: CGI.pm HTML shortcutsby OeufMayo (Curate) |
on Apr 19, 2001 at 23:00 UTC ( [id://73932]=note: print w/replies, xml ) | Need Help?? |
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, 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>--my $OeufMayo = new PerlMonger::Paris({http => 'paris.mongueurs.net'});</kbd>
In Section
Seekers of Perl Wisdom
|
|