use Sys::Hostname; use Socket; my $hostname = gethostbyaddr(gethostbyname(hostname()),AF_INET); print "$hostname\n";
Update: The reason I included the calls to gethostby* is in case you want the domainname also. hostname() from Sys::Hostname doesn't always include that.
--
dempa
In reply to Re: Find a networked computer name
by dempa
in thread Find a networked computer name
by surfmonkey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |