#!/usr/bin/perl -w
use strict;
use Socket;
my $c = inet_aton("192.168.1.1");
print "$c\n";
my $min = unpack("N", inet_aton("192.168.1.1"));
my $max = unpack("N", inet_aton("192.168.2.255"));
my $ip = unpack("N", inet_aton("192.168.2.34"));
print "$min $ip $max\n";
if ($ip >= $min && $ip <= $max) {
print "Valid
";
} else {
print "Invalid
";
}
阅读(1278) | 评论(0) | 转发(0) |