in reply to How do I get QUERY_STRING when I use sockets?

First, you might want to try using HTTP::Daemon, as you can do something like this:
$new_daemon = $daemon->accept(); my $r = $new_daemon->get_request; my $request = $r->url->epath;
and $request will have what you want.

You can also read from the NEW_SOCKET filehandle and parse the request yourself:

my $line = (<NEW_SOCKET>); $line =~ m#GET http://(.*)/(.*)#;
and you'll have good stuff in $1 and $2. Why do I know this? Been working on it lately.