programming-examples/perl/Network/Get the DNS address of a host by using inet_ntoa and inet_aton.pl
2019-11-15 12:59:38 +01:00

7 lines
147 B
Perl

use Socket;
$site_name = 'www.cpan.org';
$address = inet_ntoa(inet_aton($site_name));
print "The DNS address of www.cpan.org is $address";