I almost got it to work but no dice. It matches everything. Must be the if line. What does the regex m{($RE{net}{IPv4})}g actually do here? I know what the line means from the documentation for that module, but what is the exact purpose in this script?
use strict;
use warnings;
use Regexp::Common qw( net );
open ( IPS, '<', "TEST_IPS.txt" ) || die "can't open IPS!";
open ( RULES, '<', "test_rules.txt" ) || die "can't open file!";
my %interesting_ips;
while( <IPS> ) {
chomp;
$interesting_ips{ $_ } = 1;
}
while( my $fw_line = <RULES> ) {
if ($fw_line =~ m{($RE{net}{IPv4})}g ) {
print ( $fw_line);
}
}