12 lines
231 B
Perl
12 lines
231 B
Perl
|
#!/usr/bin/perl
|
||
|
|
||
|
|
||
|
use Socket;
|
||
|
|
||
|
my $packed_address = gethostbyname("localhost");
|
||
|
unless ($packed_address) {
|
||
|
print "$_ => ?\n";
|
||
|
next;
|
||
|
}
|
||
|
my $dotted_quad = inet_ntoa($packed_address);
|
||
|
print "$_ => $dotted_quad\n";
|