my $url; if ($cgi->request_method eq 'GET') { # Can't use ->param('url') because the client is # providing the parameters in a stupid format. ( $url = $ENV{QUERY_STRING} ) =~ s/^.*[?&]url=//s; } else { $url = $cgi->param('url'); }