in reply to Not Matching String is Matching

Check your file and ensure that the ip address is actually in the eleventh semicolon delimited field. If not then $src will not contain the ip address.

This snippet skips them just fine.

use strict; use warnings; my $ignore = qr(192\.168\.188\.3|192\.168\.11\.141|192\.168\.140\.110| +192\.168\.186\.192|192\.168\.186\.166|192\.168\.139\.50|192\.168\.139 +\.198|192\.168\.132\.101); while (<DATA>){ print if ($_ !~ /$ignore/); } __DATA__ 192.168.188.3 192.168.11.141 192.168.140.110 192.168.186.192 192.168.186.166 192.168.139.50 192.168.139.198 192.168.132.101 192.168.188.4 192.168.11.142 192.168.140.111 192.168.186.193 192.168.186.167 192.168.139.51 192.168.139.199 192.168.132.102

Update: Aha! The qr needs the ip addresses all on one line. You have added whitespace in yours.

Replies are listed 'Best First'.
Re: Re: Not Matching String is Matching
by Dru (Hermit) on Aug 16, 2003 at 15:07 UTC
    Thanks, I figured it out. Something to do with vim and the temp files it makes while editing. Perl was executing one of the temp files rather then the file I thought it was. The above works now(with the whitespace removed of course).

    -Dru