Skip Menu |

This queue is for tickets about the Schedule-Cron CPAN distribution.

Report information
The Basics
Id: 19192
Status: resolved
Priority: 0/
Queue: Schedule-Cron

People
Owner: Nobody in particular
Requestors: jamie [...] mccarthy.vg
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.9
Fixed in: (no value)



Subject: Numeric sort on "*" throws warning
The warning Argument "*" isn't numeric in sort at /usr/local/share/perl/5.8.7/Schedule/Cron.pm line 907. is thrown by Schedule::Cron. Apparently under some circumstances perl does not bother to call a custom sort function when sorting an array of size 1, but under others it does. I'm unable to come up with a good small test case but when running my code, calling $cron- Show quoted text
>get_next_execution_time("0-59 * * * *", time) produces four lines of the above warning, one
for each "*". If you want a small test case I can probably produce one with some effort. However, the fix is pretty simple: --- Cron.pm.orig 2005-01-03 12:25:19.000000000 -0500 +++ Cron.pm 2006-02-14 14:26:52.000000000 -0500 @@ -904,7 +904,7 @@ push @res,$t; } } - push @expanded, [ sort { $a <=> $b} @res]; + push @expanded, ($#res == 0 && $res[0] eq '*') ? [@res] : [ sort { $a <=> $b} @res]; } # Calculating time:
On Mi. 10. Mai 2006, 14:12:02, JAMCC wrote: Hi Jamie, Show quoted text
> The warning > > Argument "*" isn't numeric in sort at > /usr/local/share/perl/5.8.7/Schedule/Cron.pm line > 907. > > is thrown by Schedule::Cron. Apparently under some circumstances perl > does not bother to > call a custom sort function when sorting an array of size 1, but under > others it does. I'm > unable to come up with a good small test case but when running my > code, calling $cron-
> >get_next_execution_time("0-59 * * * *", time) produces four lines of
> the above warning, one > for each "*".
Sorry for the long silence, but since nowadays (and the last four years ) I mostly program with a language from the other side (java ;-), I don't experienced much pressure to maintain this module (which seems to be rather stable, though). Sorry for that. However, I just released 0.95 containing some of the collected bugfixes, including this one. I applied your patch and I would like you to test 0.95 whether it fits your purpose. If so, I intend to release a version 1.0 at the end of this year. Thanks a lot for your contribution (and your patience ;-) .... ...roland