Help for this page

Select Code to Download


  1. or download this
    my ($s,$e) = unpack 'N2',1.2.3.4 . 1.2.4.2;
    printf("%vd\n",pack 'N',$_) for ($s..$e)
    
  2. or download this
    sub ip_to_num {
      my $ip = shift;
    ...
      $n = $n*256+$_ for (split /\./,$ip);
      $n
    }