in reply to Re: finding my hostname
in thread finding my hostname

But since you'd of course be using CGI you could just use virtual_host and/or server_name instead of mucking with the environment directly.