develooper Front page | perl.perl5.porters | Postings from February 2000

Re: fixing Sys::Hostname

From:
Tom Christiansen
Date:
February 8, 2000 05:54
Subject:
Re: fixing Sys::Hostname
Message ID:
29802.950018063@chthon
>  ($host) = gethostbyname('localhost');

>Sadly most UNIX boxes don't add a sane alias to their /etc/hosts file
>so that trick is not portable.

    % grep localhost /etc/hosts
    127.0.0.1	localhost	

--tom



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About