Cron定时器的问题
1. #!/usr/bin/perl -w
2. use Schedule::Cron;
3.
4. sub dispatcher
5. {
6. print "ID: ",shift,"\n";
7. print "Args: ","@_","\n";
8. }
9. sub check_links
10. {
11. system "date";
12. }
13.
14. my $cron = new Schedule::Cron(\&dispatcher);
15. $cron->add_entry("* * * * * 0-59/2",\&check_links);
16. $cron->run(detach=>1,pid_file=>"pid.txt");
17. sleep 100;
怎么什么输出都没有,
如果去掉detach=>1是可以的,但run会住塞住