$value=$2*1.0;
if ( ($value <=10 ) || ( $value >=200 ) {
        do_something();
}
On Mon, 22 Mar 2004, Matt Bazan wrote:

> Date: Mon, 22 Mar 2004 15:02:12 -0800
> From: Matt Bazan <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Need help pruning data..
> 
> Hi all,
>       I've got an array that contains several dozen IP addresses
> (along with a bunch of garbage output from running the NMAP command).  I
> want to find the fastest, cleanest way to remove all IP address who's
> last octet is 10 or below and all IP addresses who's last octet is 200
> or higher.  I can think of several ways to do this by using reg ex's and
> looping through the data but am wondering if there is a faster way, or,
> if not, if a cleaner way than what I've come up with:
> 
> my $bad_ip;
> my @results = `c:/perl/nmap/nmap.exe -sP -n $Subnet`; #subnet is a /24
> private IP block
> foreach (@results) { 
>       if (/(\d+\.\d+\.\d+\.(\d+))/ { #match on IP addresses only
>               if ($2 =~ <reg ex to match numbers 10 or below> or
> <regex to match numbers 200 or                greater>) {
>                       next;
>               }
>               else {
>               ..do something..
>               }
>       }
> }     
> 
> 
> Thanks,
>       Matt
> 
> _______________________________________________
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 

-- 
Angelos Karageorgiou
Masters of Computer Science
City University of New York
http://www.unix.gr

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to