Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use strict;
    ...
    
    #### TRY02: One-liner in dotted notation form...
    print "TWO:\n",join('.',unpack('C4', (gethostbyname($host))[4])),"\n";
    
  2. or download this
    perl -MSocket -e 'print inet_ntoa(scalar(gethostbyname("hostname")))'