##
if ( defined $rulelist->{$rulenum}->{REGION} ){
my $rule = $rulelist->{$rulenum}->{REGION};
if ( $rule =~ s/!// ){ # handles negation
if ( $line -> {REGIONID} == $rule ){ next RULE };
}
elsif ( $line -> {REGIONID} != $rule) { next RULE };
...
##
##
if ( defined (my $rule = $rulelist->{$rulenum}->{REGION} )){
next RULE if ( $rule =~ s/!// && $line->{REGIONID} == $rule);
next RULE if ( $line->{REGIONID} != $rule);
...