kill some 5.28 warnings
[spider.git] / perl / Filter.pm
index 12caeef398d21c20b95d1f87e43b48d9c1bdd11d..a422b014a926d31eb2779cbd9a587a4ff695a686 100644 (file)
@@ -231,13 +231,15 @@ sub it
        my $hops = $self->{hops} if exists $self->{hops};
 
        if (isdbg('filter')) {
+               my $call = $self->{name};
                my $args = join '\',\'', map {defined $_ ? $_ : 'undef'} (ref $_[0] ? @{$_[0]} : @_);
                my $true = $r ? "OK " : "REJ";
                my $sort = $self->{sort};
                my $dir = $self->{name} =~ /^in_/i ? "IN " : "OUT";
-               
+
+               $call =~ s/\.PL$//i;
                my $h = $hops || '';
-               dbg("$true $dir: $type/$sort with $asc on '$args' $h") if isdbg('filter');
+               dbg("Filter: $call $true $dir: $type/$sort with '$asc' on '$args' $h") if isdbg('filter');
        }
        return ($r, $hops);
 }
@@ -370,7 +372,7 @@ sub parse
        my $filter;
        my ($flag, $call);
        my $s;
-       my $user;
+       my $user = '';
        
        # check the line for non legal characters
        dbg("Filter::parse line: '$line'") if isdbg('filter');
@@ -548,11 +550,13 @@ sub parse
                }
        }
 
-       # tidy up the user string
-       $user =~ s/\&\&/ and /g;
-       $user =~ s/\|\|/ or /g;
-       $user =~ s/\!/ not /g;
-       $user =~ s/\s+/ /g;
+       # tidy up the user string (why I have to stick in an if statement when I have initialised it I have no idea! 5.28 bug?
+       if ($user) {
+               $user =~ s/\&\&/ and /g;
+               $user =~ s/\|\|/ or /g;
+               $user =~ s/\!/ not /g;
+               $user =~ s/\s+/ /g;
+       }
        
        return (0, $filter, $fno, $user, $s);
 }
@@ -581,7 +585,8 @@ sub cmd
        
        $r = $filter->write;
        return (1,$r) if $r;
-       
+
+       $filter->install(1);            # 'delete'
        $filter->install;
 
     return (0, $filter, $fno);