$site = 'http://www.perlmonks.org/index.pl'; $user = 'Clive ;-)'; # my test case for whitespace and funny chrs use URI; my $uri = URI->new($site); $uri->query_form( node => $user ); print $uri->as_string;