in reply to to $Env{'HTTP_HOST'} or to $Env{'SERVER_NAME'}, that is the question.
IMHO, the best way to get at that information is through CGI.pm's method virtual_host():
use CGI; my $cgi = CGI->new; my $domain = $cgi->virtual_host;
It will attempt to Do The Right Thing in determing the virtual host's name. I believe it is cleaner, and more portable to use CGI's methods to access the CGI specific environment variables, than to access them directly by hand.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (dkubb) Re: (2) to $Env{'HTTP_HOST'} or to $Env{'SERVER_NAME'}, that is the question.
by RatArsed (Monk) on Jun 29, 2001 at 13:05 UTC | |
by Anonymous Monk on Oct 13, 2020 at 07:46 UTC |