use CGI; my $cgi = CGI->new; my $domain = $cgi->virtual_host;