n run for an x number of seconds 60 at a
minimum or 120 maybe even 120 as your code might not get to the end of
the loop before then. Using alarm or any type of module based on this
function will ensure that you will perform the same action a lot closer to
your desired 60 second mark. Using Tim
On Fri, Oct 26, 2012 at 8:16 PM, Unknown User
wrote:
> I have code that goes something like this:
>
>
> my $start = time();
> my $delay = 60;
> ...
>
> while (my $line = <$fh>) {
> my $err;
> ...
> ...
> my $timenow = time();
> if ( $timenow - $start >= $delay ) {
>
I have code that goes something like this:
my $start = time();
my $delay = 60;
...
while (my $line = <$fh>) {
my $err;
...
...
my $timenow = time();
if ( $timenow - $start >= $delay ) {
$start = $t;
dumpstats($err);
$err = {};
ntents of variable using alarm()
>
> On Fri, Aug 20, 2010 at 04:34, Kammen van, Marco, Springer SBM NL
> wrote:
>> Hi All,
>>
>> I want to use timers to check if certain variables are set and if not
>> send some data back to a client...
>>
>> Been
Original Message-
From: Chas. Owens [mailto:chas.ow...@gmail.com]
Sent: Friday, August 20, 2010 4:07 PM
To: Kammen van, Marco, Springer SBM NL
Cc: beginners@perl.org
Subject: Re: test contents of variable using alarm()
On Fri, Aug 20, 2010 at 04:34, Kammen van, Marco, Springer SBM NL
On Fri, Aug 20, 2010 at 04:34, Kammen van, Marco, Springer SBM NL
wrote:
> Hi All,
>
> I want to use timers to check if certain variables are set and if not
> send some data back to a client...
>
> Been searching for this a while now, but all I can find on alarm are
> examples on timing out comman
Hi All,
I want to use timers to check if certain variables are set and if not
send some data back to a client...
Been searching for this a while now, but all I can find on alarm are
examples on timing out commands
So something like:
sub timeout {
$timeout = 5;
eval {
l
On Wed, Apr 1, 2009 at 20:28, wrote:
> Away from PC so I cannot hookup
> Is alarm perls internal function?
snip
The alarm function is part of Core Perl.
--
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.
--
To unsubscribe, e-mail: beginners-unsu
Away from PC so I cannot hookup
Is alarm perls internal function?
-Original Message-
From: "Chas. Owens"
Date: Wed, 1 Apr 2009 10:18:51
To: Kelly Jones
Cc:
Subject: Re: Calling subroutine every second using alarm fails
On Wed, Apr 1, 2009 at 08:48, Kelly Jones wrote:
On Wed, Apr 1, 2009 at 08:48, Kelly Jones wrote:
> I want a script that constantly accepts user input, but runs a
> subroutine every second to do other work. My attempt:
>
> $|=1; $SIG{'ALRM'}= "\&alarm_sub"; &alarm_sub;
> while (<>) {print "You typed: $_\n";}
> sub alarm_sub {print "ALARM!\n"; al
>> Original Message
>> Subject: Calling subroutine every second using alarm fails
>> From: Kelly Jones
>> Date: Wed, April 01, 2009 5:48 am
>> To: beginners@perl.org
>>
>>
>> I want a script that constantly accepts user input, b
> Original Message
> Subject: Calling subroutine every second using alarm fails
> From: Kelly Jones
> Date: Wed, April 01, 2009 5:48 am
> To: beginners@perl.org
>
>
> I want a script that constantly accepts user input, but runs a
> subroutine ev
I want a script that constantly accepts user input, but runs a
subroutine every second to do other work. My attempt:
$|=1; $SIG{'ALRM'}= "\&alarm_sub"; &alarm_sub;
while (<>) {print "You typed: $_\n";}
sub alarm_sub {print "ALARM!\n"; alarm 1; return;}
fails miserably. What's the right way to do
13 matches
Mail list logo