#!/usr/bin/perl -w use strict; # ip address limit # 83.1.1.1 my $a_end = 83; my $b_end = 1; my $c_end = 1; my $d_end = 1; # ip address start # 82.1.1.1 my $a_start = 82; my $b_start = 1; my $c_start = 1; my $d_start = 1; my @calc = ($a_start, $b_start, $c_start, $d_start, $a_end, $b_end, $c_end, $d_end); my $calc; my $calc1; my $calc2; foreach $calc (@calc) { if ($calc<100) { if ($calc<10) { $calc="00".$calc; } else { $calc="0".$calc; } } } $calc1 = $a_start . $b_start . $c_start . $d_start; $calc2 = $a_end . $b_end . $c_end . $d_end; print $calc1." + ".$calc2." = \n"; if ($calc1>=$calc2) { print "error!\n"; exit(0); } exit(0);