use URI;
use HTML::Entities;
my $u = URI->new("/my/cgi");
$u->query_form("gun" => "Smith & Wesson", drink => "Jack Daniels");
print
'',
encode_entities("shoot with Smith & Wesson, and drink Jack Daniels"),
'', "\n";
####
shoot with Smith & Wesson, and drink Jack Daniels