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
Jay Savage wrote:
>
> On 7/26/06, Rob Dixon <[EMAIL PROTECTED]> wrote:
>
> [sarcasm snipped]
No sarcasm intended Jay, and also I'm not sure what you took that way. I
corrected an error in the Perl in my original response and made what I thought
was a fairly non-toxic remark about enhancing code n
On 7/26/06, Rob Dixon <[EMAIL PROTECTED]> wrote:
[sarcasm snipped]
> If you want numbers, look for numbers. Because if there's a typo in the file,
> Perl will quite happily go on and use non-numeric matches of \S in subsequent
> arithmatic, yeilding unexpected and difficult to debug results
Hello Jay
Jay Savage wrote:
> On 7/25/06, Rob Dixon <[EMAIL PROTECTED]> wrote:
>
>>
>> my @values;
>>
>> while (<$fh>) {
>>next unless /(\S+)\s*=\s*(\S+?)\s*;?/;
>>push @values, $1, $2;
>> }
>>
>> @values;
>>}
There is a problem with my code which means th
On 7/25/06, Rob Dixon <[EMAIL PROTECTED]> wrote:
my @values;
while (<$fh>) {
next unless /(\S+)\s*=\s*(\S+?)\s*;?/;
push @values, $1, $2;
}
@values;
}
Be careful with this. With regex, it's (usually) better to seach for
the things you want than to try t
On 07/25/2006 02:23 PM, 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
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 b
On Tuesday 25 July 2006 09:23, 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 lo
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 wher