Help for this page

Select Code to Download


  1. or download this
    #/usr/bin/perl
    use warnings;
    ...
    $peer_host = gethostbyaddr($ipaddr, AF_INET);
    $peer_addr = inet_ntoa($peer_host);
    print $peer_addr;
    
  2. or download this
    Use of uninitialized value in subroutine entry at huh2 line 7, <STDIN>
    + line 1.
    Bad arg length for Socket::inet_ntoa, length is 0, should be 4 at huh2
    + line 7, <STDIN> line 1.
    ...
    $peer_host = gethostbyaddr($ipaddr, AF_INET);
    $peer_addr = inet_ntoa($peer_host);
    print $peer_addr;