in reply to Finding a machine's name?
One way, my $hostname = `/bin/hostname`; Given that, you can call gethostbyname to get more information.
If you're in a shell environment, you're likely to have the purely perlish,
That will probably be available in the cgi environment, too, but probably not in cron.my ($name, $aliases, $addrtype, $length, @addrs) = gethostbyname $ENV{'HOSTNAME'};
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Finding a machine's name?
by terra incognita (Pilgrim) on Sep 28, 2004 at 14:36 UTC | |
|
Re^2: Finding a machine's name?
by Red_Dragon (Beadle) on Sep 28, 2004 at 14:47 UTC |