use CGI::Enurl; $href = 'script.pl?' . enurl({ company => 'Smith & Jones', place => 'Brussels' }); If you happen to have Interpolation.pm (0.68) you may do this: use CGI::Enurl; use Interpolation '?:@->$' => sub { '?'.enurl({@_})}; print qq{click here\n};