
Schedule::Cronchik - a cron-like addition to CGI scripts or something like it.

use Schedule::Cronchik;
my $cron = new Schedule::Cronchik("0,10,20,30,40,50 * * * *", \&do_regular_task, "/tmp/lr.mark");
$cron->run();

Sometimes I need a task, peformed on regular basis. Unfortunately, not so much hostings allows you to write your own crontabs, and getting a more powerful hosting have too high cost for required task. Well, this module give you a partial solution.

new(entry,coderef,markfile)create a new Schedule::Cronchik object.
entrya cron-like entry with same behavoir. Note: the last field, a week day, now is simply ignored. Also Vixie-like extensions is not supported, only sequences with ',' and ranges with '-'
coderefa reference to code to run when at desired time
markfilea filename for file where information about last run will be stored
run()a method to start execution of specified tasks. Return 0 if nothing happened or 1 when coderef was executed

Ivan Frolcov ifrol@cpan.org