$ENV{QUERY_STRING} =~ s/(['"])/uc sprintf("%%%02x",ord($1))/eg; my $url = join ( "?", CGI::url ( -absolute => 1 ) || "/", $ENV{QUERY_STRING} || () );