Re: Addition to: How do I find out my hostname/domainname/IP address?
[email protected] (brian d foy)
| Newsgroups | perl.perlfaq.workers |
|---|---|
| Message-ID | <281220021027324927%[email protected]> |
In article <[email protected]>, <[email protected]> wrote: > > 9.23: How do I find out my hostname/domainname/IP address? > > > > my $addr = inet_ntoa(scalar gethostbyname($host || 'localhost')); > > If the host name is not important, that can be simplified to: > > my $addr = join(".", unpack C4,((gethostbyname "")[4])); i've added this to my queue of things to catch up on. i'm on holiday at the moment, so don't expect anything soon. :) -- brian d foy, [email protected]