in reply to I can't get cron to work on cygwin...
my $script = 'foobar.pl'; my $sleep_time = 60*60; # sleep for 1 hour. while (1) { system("foobar.pl"); sleep($sleep_time); }
use Schedule::Cron; sub run_scripts { system("foobar.pl"); } # Create new object with default dispatcher my $cron = new Schedule::Cron(); # Add dynamically crontab entry # invoke run_scripts() every 0 minute past # each hour. $cron->add_entry("0 * * * Mon-Fri", \&run_scripts); # Run scheduler $cron->run(detach=>1);
open(I,$0);<I>;$~=$/;$/='~';$_=<I>;($/)=/(.)$~/;s/[$~~]//g;/(v)/;$-=$-[0];s;\Q$/\E;$~;g;($/,$^)=/^(.)(.)/;
#% xxxxxx xx-+ xx xxx xx xx xx xx xxx xxxxx+ xx xx xxxx xxxxx ......+
#x xxxxvxxx xx xx xv xxxx x+ %+ ===== xx xx xx xx x+ =x xx xx xx xx xx ...+
#x xx xx xx xx xx xx xx xx xxx+ xxxxxx xx +x xx xx+x- xxxx xxxx ........+
#% xx xx xx xx xx xx xx x+ xx xx =+=== xx xx xxxx-xx xx =x +x xx xx xx xx ...+
#% xx xx xx -+x+ xxx+ xx xx xx xx xx x+ xx xxx+xx xx xx xxxx xx xx ....+~
for(split/$~/){s,[ $/],,g;/(.)$/;$l=$-[0];/(.)/||next;$_=chr$-+$l;$".=($1=~/$^/)?" \u$_":$_;}print$";
|
|---|