in reply to Not Matching String is Matching
Two, build your regexp from a data table. This gives the opportunity to use modules like Regex::PreSuf to optimize long lists. Think of all the time wasted in backtracking on the "192.168." part over and over.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 )x ;
Lastly, now that the list of ignored IPs is really a list, it can come from a configuration file instead of from the script itself.use Regex::PreSuf; my @ignore = qw( 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 ); my $ignorex = presuf( map { s|\.|\\.|g } @ignore );
--
[ e d @ h a l l e y . c c ]
|
|---|