Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

CGI.pm - Dreamweaver or somesuch?

by Anonymous Monk
on Apr 27, 2001 at 21:36 UTC ( #76182=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I've happily got the basics of mod-perl, DBI, and CGI.pm down...

Now I'd like to make some nice looking webpages, not just the uglies that I am currently auto-generating with CGI.pm.

How can I do this? CGI.pm allows me to do so much programatically: populate pop-up boxes based on database lookups, decide whether or not to print certain elements of the page based on database lookups...

Can I still do these wonderful things and yet have it come out slick looking? Thanks for any advice!

Phil R Lawrence

Comment on CGI.pm - Dreamweaver or somesuch?
(jeffa) Re: CGI.pm - Dreamweaver or somesuch?
by jeffa (Chancellor) on Apr 27, 2001 at 21:39 UTC
    How about a templating system? I wrote a tutorial on HTML::Template here.

    There is also Template-Toolkit which is more powerful, and consequently more complex.

    Jeff

    R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
    L-L--L-L--L-L--L-L--L-L--L-L--L-L--
    
    http://search.cpan.org/search?dist=Template-Toolkit
Re: CGI.pm - Dreamweaver or somesuch?
by Masem (Monsignor) on Apr 27, 2001 at 21:41 UTC
    As we've talked about recently (such as here), you want to try separate perl code from HTML as much as possible, and the various templating solutions that exist (HTML::Mason, HTML::Template, or Template, to name a few) help you do this.

    The key is to collect all the data that you need in the perl part of the program, and then throw that to the template file. Once you have the perl logic down, it's very easy to play whatever pretty-ing games you need to do with the HTML to make the output look good. You just simply need to embed the data from perl into the appropriate places.

    This approach makes the job of programming web sites for both function and appearence very simple.


    Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
Re: CGI.pm - Dreamweaver or somesuch?
by rchiav (Deacon) on Apr 27, 2001 at 21:45 UTC
    Anything you can do with a WYSIWYG HTML editor like "Dreamweaver" or other bulky programs, you can do with a text editor. The only diffeence is that you have to know what you're doing when you do it by hand. All Dreamweaver does is generate the HTML for you. There's nothing special about the files that it generates, well except for the fact that they are much bigger than they should be because it inserts a lot of HTML that isn't needed.

    If you're willing, I'd highly recomend learning how to write the HTML yourself. Take a look at W3C's Tutorials for starters. There's also a good refrence here from Microsoft. Then you can take that knowledge and use CGI.pm to create what you want. It's not CGI.pm's fault that the pages don't come out the way that you want. It's just generating the HTML that you're telling it to.

    Hope this helps..
    Rich

Re: CGI.pm - Dreamweaver or somesuch?
by tphyahoo (Vicar) on Feb 23, 2005 at 13:09 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2014-12-20 23:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (99 votes), past polls