May I commend unto you the URI::Escape module.
Update d'oh! posted too soon. Of course you can do w/o that module, just use CGI's version of that method. But the principle is the same
I'd do something like this: assuming you have all the name/value pairs stored in a hash with names as keys and values as values(duh =)
my $query_string; foreach (keys %nvpairs) { # guess which module defines uri_escape =) $query_string .= "&" if $query_string; $query_string .= "$_=". uri_escape($nvpairs{$_}); } # assuming $q is a CGI query object ... print $q->a({href=>"http://www.foo.com?$query_string"}, "click me!");
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
In reply to RE: Best way of doing CGI passthroughs
by arturo
in thread Best way of doing CGI passthroughs
by stephen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |