30 $ip4=1;
31 $ip3=1;
32 $ip2++;
33 if($x eq 'c' || $x eq 'b') {$ip3=255; $ip2=255;}
34 }
35 }
Analysis
Line 1 is commonly used in UNIX and Linux Perl configurations as the location for the
main Perl binaries.This is not necessary in nearly all Win32 installations and configura-
tions. Line 2 checks in an unintelligent fashion, that two parameters were passed to the
script via the command line and if for some reason there were less than two then a
Usage statement is printed to STDOUT.
Lines 5 and 6 set the variables to that of the parameters passed to the command line.
Notice that there is no error checking on these variables before parsing the values.This
is deliberate, because the main goal for this exercise is to learn how to increase IP
addresses.
Line ...