Help for this page

Select Code to Download


  1. or download this
    use strict;
    use Socket;
    ...
    my $p  = gethostbyname('localhost');
    my $ip = inet_ntoa($p);
    print "$ip\n";
    
  2. or download this
    perl -MSocket -le 'print scalar gethostbyaddr(inet_aton("127.0.0.1"),A
    +F_INET)'