Re: Dynamically updating perl variables

2006-07-29 Thread Michael Gale
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

Re: Dynamically updating perl variables

2006-07-26 Thread Rob Dixon
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

Re: Dynamically updating perl variables

2006-07-26 Thread Jay Savage
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

Re: Dynamically updating perl variables

2006-07-26 Thread Rob Dixon
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

Re: Re: Dynamically updating perl variables

2006-07-25 Thread Jay Savage
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

Re: Dynamically updating perl variables

2006-07-25 Thread Mumia W.
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

Re: Dynamically updating perl variables

2006-07-25 Thread Rob Dixon
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

Re: Dynamically updating perl variables

2006-07-25 Thread Beau E. Cox
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

Dynamically updating perl variables

2006-07-25 Thread siegfried
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