On 5/16/07, sivasakthi <[EMAIL PROTECTED]> wrote:
Suppose i have checked the group of  I/P addresses for deleting opting
then what should i do??
Is there any inbuilt function there for that requirement??
snip
> while(<FILE>) {
>     my ($time,$lport,$ip,$stats,$rport) = split;
>     next if $ip eq '172.16.2.80';
>     # using those values above to create hash,based on what form of hash
> you needed.
> }

Assuming that you have a list of IP addresses you want to skip in @ip,
you could say

#!/usr/bin/perl

use strict;
use warnings;

OUTER:
while(<FILE>) {
  my ($time, $lport, $ip, $stats, $rport) = split;
  for my $skip_ip (@ip) {
     next OUTER if $ip eq $skip_ip;
  }
  # using those values above to create hash
  #based on what form of hash you needed.
}

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to