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

Re: fixing Sys::Hostname

Thread Previous | Thread Next
Ilya Zakharevich
February 7, 2000 14:09
Re: fixing Sys::Hostname
Message ID:
On Mon, Feb 07, 2000 at 10:00:31PM +0000, Nick Ing-Simmons wrote:
> >Suppose I'm behind a temporary-IP-assigned SLIP dialup.  I have
> >$ENV{HOSTNAME} set to some internal-use-only value which means nothing
> >to the outside world.  What would gethostname() do?
> If I recall correctly $ENV{HOSTNAME} is set to whatever gethostname()
> returns ;-)

Well, here it is the other way around...  :-( 

One possible solution is to use the system-wide database of settings:
when the slip program connects, it *could* fill some entry into the

But given that most slip drivers I have seen for OS/2 do not do this,
the question is moot.  One could run netstat to get the address of
sl0, and then get the name back, but then one *needs* to know that it
*is* slip.

Another datapoint: a lot of homes run a homewide NIC network which is
connected to the outside via a dialin node through one of the
computers on the network.  Mind boggles what hostname could return...


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About