in reply to Re: beginner syntax question
in thread beginner syntax question
#!/usr/bin/perl -w # IP ranger use strict; my ($stip,$edip,$count,@openip); open(IPFILE,"<iplist.txt") # open readonly || die "Could not open iplist.txt:$! \n"; while (<IPFILE>) { chomp; ($stip,$edip) = split(/:/,$_,2); # split(/:/); print "$stip\n"; print "$edip\n"; @openip = split(/\./,$stip); $count = @openip; print "$count\n"; # you can avoid the creation of the $count # variable and use the following statement # print scalar(@openip), "\n"; # for ($i = 0; $i <= 4; $i++) { # print "@srtip\n"; # }; }; close(IPFILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re3: beginner syntax question
by dragonchild (Archbishop) on Sep 19, 2001 at 18:09 UTC | |
|
or before ||, for || comes before or
by TGI (Parson) on Sep 19, 2001 at 20:00 UTC | |
by buckaduck (Chaplain) on Sep 19, 2001 at 20:40 UTC | |
|
Re: Re: beginner syntax question
by tommyw (Hermit) on Sep 19, 2001 at 18:11 UTC |