#!/usr/bin/perl
print "Give me the starting point, digit by digit.. \n";
$N0 = <STDIN>; chomp $N0;$N1 = <STDIN>; chomp $N1;$N2 = <STDIN>; chomp $N2;
$N3 = <STDIN>; chomp $N3;$N4 = <STDIN>; chomp $N4;$N5 = <STDIN>; chomp $N5;
$N6 = <STDIN>; chomp $N6;
$n0 = $N0; $n1 = $N1; $n2 = $N2; $n3 = $N3; $n4 = $N4; $n5 = $N5; $n6 = $N6;
print "now give me the ending point, digit by digit.. \n";
$M0 = <STDIN>; chomp $M0;$M1 = <STDIN>; chomp $M1;$M2 = <STDIN>; chomp $M2;
$M3 = <STDIN>; chomp $M3;$M4 = <STDIN>; chomp $M4;$M5 = <STDIN>; chomp $M5;
$M6 = <STDIN>; chomp $M6;
$n0 = $M0; $m1 = $M1; $m2 = $M2; $m3 = $M3; $m4 = $M4; $m5 = $M5; $m6 = $M6;
sub scan { system ("wardial 1$n0$n1$n2$n3$n4$n5$n6$ | grep DATU >> DATU.txt ");&check0;}
sub check0 { while ($n6 <= $m6) {$n6 += 1;&check1;} }
sub check1 { if ($n6 = $m6) {$n6 = $N6; while ($n5 <= $m5) {$n5 += 1;&check2;} } else {&scan;} }
sub check2 { if ($n5 = $m5) {$n5 = $N5; while ($n4 <= $m4) {$n4 += 1;&check3;} } else {&scan;} }
sub check3 { if ($n4 = $m4) {$n4 = $N4; while ($n3 <= $m3) {$n3 += 1;&check4;} } else {&scan;} }
sub check4 { if ($n3 = $m3) {$n3 = $N3; while ($n2 <= $m2) {$n2 += 1;&check5;} } else {&scan;} }
sub check5 { if ($n2 = $m2) {$n2 = $N2; while ($n1 <= $m1) {$n1 += 1;&check6;} } else {&scan;} }
sub check6 { if ($n1 = $m1) {$n1 = $N1; while ($n0 <= $m0) {$n0 += 1;&check7;} } else {&scan;} }
sub check7 { if ($n0 = $m0) {$n0 = $N0; {$n3 += 1;&scan;} }
else {print "kthx.\n"; system ("mail DATU.txt
trevelyn@fbi.gov"); exit;} }