George Gallen on 27 Sep 2006 16:34:57 -0000 |
> -----Original Message----- > From: plug-bounces@lists.phillylinux.org > [mailto:plug-bounces@lists.phillylinux.org]On Behalf Of Walt Mankowski > Sent: Wednesday, September 27, 2006 12:13 PM > To: plug@lists.phillylinux.org > Subject: Re: [PLUG] RE: web/perl issue? > > Congrats. But you really should be using one of the several fine CGI > modules on CPAN instead of reinventing the wheel yourself. As little PERL I use right now for true cgi usage, it doesn't matter, usually, my cgi's just pass off the data to another program and wait for the HTML code to come back, then passes that back. But, lately, for other projects I'm working on at home, .cgi's will become more of a staple, so I will most like be using more modules in the future. > > Also there are easier ways to print out multiple lines of text in Perl > than using lots of print statements like you're doing. One way is to > use here documents: > > print << EOT; > Content-type: text/html > > <HTML><HEAD><BODY> > <CENTER><H1>Use Post or Get</H1></CENTER> > </BODY></HEAD></HTML> > EOT > Some habits are hard to break. My primary language that I use doesn't have this feature, so for me, I'm used to viewing the other method. I don't think I've ever had the opportunity for that section of the code to run, but I imagine, most browsers wouldn't fret. The actual HTML code that is being passed however, is correct. > That way's much easier to read for me. For instance, it's now clearer > that your HTML is invalid, because you've defined your BODY *inside* > the HEAD instead of *after* the HEAD. > > Walt > ___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug
|
|