projects
/
spider.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
520b5d7
)
kill some 5.28 warnings
author
Dirk Koopman
<djk@tobit.co.uk>
Thu, 9 Jul 2020 22:24:28 +0000
(23:24 +0100)
committer
Dirk Koopman
<djk@tobit.co.uk>
Thu, 9 Jul 2020 22:24:28 +0000
(23:24 +0100)
perl/DXCron.pm
patch
|
blob
|
history
perl/Filter.pm
patch
|
blob
|
history
diff --git
a/perl/DXCron.pm
b/perl/DXCron.pm
index 12192891de1bba6939b8ade706e1feed6ca97940..c31e46f51d9a4ea47fdc4c885e03ead835ce4d47 100644
(file)
--- a/
perl/DXCron.pm
+++ b/
perl/DXCron.pm
@@
-64,11
+64,11
@@
sub cread
dbg("DXCron::cread reading $fn\n") if isdbg('cron');
open($fh, $fn) or confess("cron: can't open $fn $!");
dbg("DXCron::cread reading $fn\n") if isdbg('cron');
open($fh, $fn) or confess("cron: can't open $fn $!");
- while (<$fh>) {
+ while (
my $l =
<$fh>) {
$line++;
$line++;
- chomp;
- next if
/^\s*#/o or
/^\s*$/o;
- my ($min, $hour, $mday, $month, $wday, $cmd) = /^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(.+)$/o;
+ chomp
$l
;
+ next if
$l =~ /^\s*#/o or $l =~
/^\s*$/o;
+ my ($min, $hour, $mday, $month, $wday, $cmd) =
$l =~
/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(.+)$/o;
next unless defined $min;
my $ref = bless {};
my $err = '';
next unless defined $min;
my $ref = bless {};
my $err = '';
@@
-82,18
+82,17
@@
sub cread
if (!$err) {
$ref->{cmd} = $cmd;
push @out, $ref;
if (!$err) {
$ref->{cmd} = $cmd;
push @out, $ref;
- dbg("DXCron::cread: adding $
_
\n") if isdbg('cron');
+ dbg("DXCron::cread: adding $
l
\n") if isdbg('cron');
} else {
$err =~ s/^, //;
} else {
$err =~ s/^, //;
- LogDbg('cron', "DXCron::cread: error $err on line $line '$
_
'");
+ LogDbg('cron', "DXCron::cread: error $err on line $line '$
l
'");
}
} else {
}
} else {
- LogDbg('cron', "DXCron::cread error on line $line '$
_
'");
+ LogDbg('cron', "DXCron::cread error on line $line '$
l
'");
my @s = ($min, $hour, $mday, $month, $wday, $cmd);
my $s = "line $line splits as " . join(', ', (map {defined $_ ? qq{$_} : q{'undef'}} @s));
LogDbg('cron', $s);
}
my @s = ($min, $hour, $mday, $month, $wday, $cmd);
my $s = "line $line splits as " . join(', ', (map {defined $_ ? qq{$_} : q{'undef'}} @s));
LogDbg('cron', $s);
}
-
}
close($fh);
return @out;
}
close($fh);
return @out;
diff --git
a/perl/Filter.pm
b/perl/Filter.pm
index 867c8ddfe73533fea29a6e3b09f5f0dcd106e2d5..a422b014a926d31eb2779cbd9a587a4ff695a686 100644
(file)
--- a/
perl/Filter.pm
+++ b/
perl/Filter.pm
@@
-372,7
+372,7
@@
sub parse
my $filter;
my ($flag, $call);
my $s;
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');
# check the line for non legal characters
dbg("Filter::parse line: '$line'") if isdbg('filter');
@@
-550,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);
}
return (0, $filter, $fno, $user, $s);
}