You probably have mixed something up, if I did not misunderstand your question.
It's not HTTP_HOST that derives from a Perl env var. It's that CGI, or a similar mechanism, that exposes the HTTP/1.1 header "Host:" as the HTTP_HOST env var to the server process responsible for handling the request, which can probably be a Perl process, as specified in the
CGI Specification, that writes "... the header lines received from the client, if any, are placed into the environment with the prefix HTTP_ followed by the header name. Any - characters in the header name are changed to _ characters.".
As for how the "Host" HTTP header is composed, it actually follows what the HTTP specification says about the header. To save space, you can read the specifics at
http://www.w3.org/Protocols/rfc2616/....html#sec14.23.