Walt Mankowski on 27 Sep 2006 16:13:55 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] RE: web/perl issue?


On Wed, Sep 27, 2006 at 11:45:19AM -0400, George Gallen wrote:
> never mind...I found the problem. I needed to eliminate
> the spaces between the 0-9] and the [a. Didn't see them.
> 
> >    $key =~ s/%([a-fA-F0-9] [a-fA-F0-9])/pack("C",hex($1))/eg;
> >    $value =~ s/%([a-fA-F0-9] [a-fA-F0-9])/pack("C",hex($1))/eg;
> > 

Congrats.  But you really should be using one of the several fine CGI
modules on CPAN instead of reinventing the wheel yourself.  

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

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

Attachment: signature.asc
Description: Digital signature

___________________________________________________________________________
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