I'm not sure that I understand what you are asking, but
unless I'm missing something special about 'Socket', I
think you should just use one of the CGI modules...
Have you tried:
use CGI;
my $cgi = new CGI;
my $url = $cgi->param(shift($cgi->param());
or something else along those lines???
Good Luck 8-}