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 = {};
        }
}
...

I wonder if it would be possible to replace this loop with a handler
based on alarm.
If it is possible, which would be more efficient?

Thanks

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to