Hey,
Why not use signals to do this, for example:
use sigtrap qw(handler shutdown USR2);
sub shutdown {
&logging("Shutdown requested by signal");
$stop=1;
}
Michael
siegfried wrote:
I have some cron jobs running perl for many hours. Sometimes I would like to
control things dynamically or even shutdown the job if I notice it is not
running properly (based on the log files).
Below is what I am doing presently (inside a loop) and I feel there must be
a more elegant solution where I can label my values. Presently my file
"delay.txt" looks like
1
1
And I would prefer it look like
delay= 1;
continue = 1;
Thanks,
Siegfried
sub getDelay{
local *FILE;
my $delay;
my $continue;
open (FILE,"delay.txt");
$delay = <FILE>;
$continue = <FILE>;
$delay = $delay + 0; # force integer
close(FILE);
return ($delay, $continue);
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>