> On Wed, 2007-05-16 at 08:01 -0400, Chas Owens wrote: > >> >> 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. >> } > > I have checked your suggestions, but it shows the error of > Label not found for "next OUTER" at ./test.pl line 11, <FILE> line 9
mmmn,if I was you I would write, $hash{$_} =1 for (@ip_skip); while(<FILE>) { my ($time, $lport, $ip, $stats, $rport) = split; next if exists $hash{$ip}; # using those values above to create hash #based on what form of hash you needed. } Don't think Label is useful in this time. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/