siegfried wrote:
> I have a cron job running perl and it is taking a very long time --
> sometimes over 24 hours.
>
> How can I have cron schedule my job daily, or even hourly, and have the perl
> code exit if a previouse instance of the job is still running?
>
> Some have suggested creating a file in /tmp and checking it before
> proceding. But what if a cron job exits prematurely, perhaps because of a
> division by zero, and does not delete the /tmp file?
It depends on whether the division by zero happens at compile time:
$ perl -le' my $x = 20 / 0; END { warn "oops" }'
Illegal division by zero at -e line 1.
Or at run time:
$ perl -le' my $x = 20 / $ARGV[0]; END { warn "oops" }' 0
Illegal division by zero at -e line 1.
oops at -e line 1.
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>