On Sun, 16 Sep 2012 12:46:08 -0700, jmrhide-perl wrote:
> Does it look OK?

This is a prime example of something that a test harness would be very 
useful for, then we'd all know the answer.

There may be some entirely different reason why your provider thinks this 
script is consuming excessive resources.  They may be wrong.  Having some 
idea of how long it takes to execute would be good:

END {
  my $elapsed = time - $^T;
  send_mail "We took $elapsed seconds to run at " . localtime . "!"
    if $elapsed > $MAX_PERMISSIBLE_RUN_TIME;
}

If all else fails, install your own timeout:

alarm $MAX_PERMISSIBLE_RUN_TIME;
$SIG{ALRM} = sub { die "Exceeded $MAX_PERMISSIBLE_RUN_TIME timeout" };

-- 
Peter Scott
http://www.perlmedic.com/     http://www.perldebugged.com/
http://www.informit.com/store/product.aspx?isbn=0137001274
http://www.oreillyschool.com/certificates/perl-programming.php

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to