Subject: | Select method with -type => 'event' returns comments. |
Hallo Scott
I send you a bug report of a minior bug in your Config::Crontab module.
The select-method of Config::Crontab called with -type => 'event' also returns comments in some cases.
Look at the following example:
michael@merkur:~/workspace/nvstart$ cat test.pl
#!/usr/bin/perl
use strict;
use warnings;
use Config::Crontab;
my $ct = new Config::Crontab;
$ct->strict(1);
$ct->file("example.cron");
$ct->read;
my @events = $ct->select( -type => 'event',
-command_re => "/bin/nvjob");
foreach my $event (@events) {
print $event->dump(), "\n";
}
michael@merkur:~/workspace/nvstart$ cat example.cron
# 25 23 * * * root /bin/nvjob hhhh
25 23 * * 0 root /bin/nvjob hhhh
michael@merkur:~/workspace/nvstart$ perl test.pl
#25 23 * * * root /bin/nvjob hhhh
25 23 * * 0 root /bin/nvjob hhhh
In my opinion, the first line should not be printed, because its a comment.
Thank you for your attention.
with greetings
Michael Strauß