Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Regex to cange HTML %?? to char(0x??);

by TGI (Parson)
on Jun 19, 2001 at 23:09 UTC ( #89781=note: print w/replies, xml ) Need Help??


in reply to Regex to cange HTML %?? to char(0x??);

All your escaping and unescaping is handled by CGI. Try this (untested) code.

use CGI; use strict; my $q = new CGI; #get a list of parameter names my @params = $q->param(); # Start HTML Output print $q->header(),$q->start_html('FOO'); # Print a table of params and values. print "<TABLE>"; print << EHTML; <TR> <TH>Parameter</TH> <TH>Value</TH> </TR> EHTML foreach (@params) { my $value = $q->param($_); print << EHTML; <TR> <TD>$_</TD> <TD>$value</TD> </TR> EHTML } print "</TABLE>", $q->end_html();

Note that I use here docs for most of the HTML generation. While CGI.pm can do HTML generation, I prefer to make minimal use of that capability. I always use its parameter handling, which is great.


TGI says moo

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2019-09-17 19:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The room is dark, and your next move is ...












    Results (215 votes). Check out past polls.

    Notices?