#!/usr/bin/perl -w use strict; use URI::Escape; use HTTP::Request; my $ru = uri_escape("http://foo.org/cgi-bin/bar.cgi?baz = qu ux;foo=di +m"); my $v=new HTTP::Request(url=>"http://foo.org/cgi-bin/bar.cgi?ru=$ru"); print $v->url, $/; =pod prints: http://foo.org/cgi-bin/bar.cgi?ru=http%3A%2F%2Ffoo.org%2Fcgi-bin%2Fbar +.cgi%3Fbaz%20%3D%20qu%20ux%3Bfoo%3Ddim call, say: $cgi->redirect( uri_unescape($cgi->param('ru')); to use the url =cut
Update: I hasten to point out the the uri_unescape() suggestion in pod is insecure if you care where the redirect goes or whether it is an url at all. Repaired a couple of pasteos.
After Compline,
Zaxo
In reply to Re: Packing a URL into a URL
by Zaxo
in thread Packing a URL into a URL
by keith
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |