Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: CGI versus CGI::* modules

by thunders (Priest)
on Jul 31, 2003 at 21:33 UTC ( #279801=note: print w/replies, xml ) Need Help??


in reply to CGI versus CGI::* modules

I really don't like to have any HTML markup mixed into my Perl code. I highly recommend moving towards something like CGI::Application + HTML::Template. Neither module is core, but both are easily availible on CPAN or through PPM.

Doing it this way for especially complex pages, i can do the initial Mockup in Dreamweaver(yeah yeah i know WYSIWYGs are evil), then simply tweak the template page to my needs. This way your logic and presentation are mostly seperated.

CGI Application has methods for getting at params (I believe it imports CGI.pm's query object.) and It takes care of headers automatically.

Replies are listed 'Best First'.
(jeffa) 2Re: CGI versus CGI::* modules
by jeffa (Bishop) on Jul 31, 2003 at 22:09 UTC
    Amen to that, but i don't think that WYWSIWYG's are evil, they are just another form of laziness. ;) I recently used Fireworks and Dreamweaver to create the templates for a website. I was handed two Photoshop files that contained the entire front page and an auxiliary page. I used Fireworks to splice up the images, and (even though Fireworks generates HTML) Dreamweaver to create the HTML. Next, add the template tags, and start coding your design. Honestly, i should mention that i had to use PHP for this site, but i was able to utilize PHP-HTML::Template.

    Another simpler (and free) way to start off templates is with HTML Tidy. Forgive my bias of operating systems:

    $ echo 1 | tidy -asxhtml > skeleton.tmpl
    Of course, remaining XHTML compliant is up to you after that, but shouldn't be hard with tools like validator.w3.org available.

    One of the kicks i get out of using HTML::Template (well, templates in general) is that i can atcually switch my "mode of thinking": when i am working on the script/module i think like a programmer, but when i am working on the template i think more like a programmer thinking like a designer. ;)

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
      Howdy!

      jeffa wrote: but i don't think that WYWSIWYG's are evil, they are just another form of laziness. ;)

      Yo Sappy! c'mere; I need a box
      /me stands on box

      So-called WYSIWYG web page editors are propagating a lie -- the same kind of lie that Font, Color, and Size menus in e-mail user agents tell. The righteous use manly-man type text editors for their HTML coding. :)

      /me steps down from soap-box

      yours,
      Michael

Re: Re: CGI versus CGI::* modules
by mbadolato (Hermit) on Aug 01, 2003 at 15:04 UTC
    I'll concur on CGI::Application. I'm using it on a project at work now, and gotta say that I'm pretty happy with how simple it makes things. And I've been a big fan of HTML::Template for a long time.

    Seeing as I haven't been assigned to any Perl projects at work for close to 3 years i was pretty happy to get this current project. I'm making use of CGI, CGI::Application, CGI::Session, HTML::Template, DBI and a few others. It's refreshing to once again have so many great tools available to me and so simple to use.

    Let the PHP fanatics claim "PEAR rocks!"... I've still yet to be impressed with it :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2021-05-08 13:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (96 votes). Check out past polls.

    Notices?