use URI; my $uri = URI->new("/myscript.pl"); $uri->query($text); my $uri_string = $uri->as_string; print qq{};