On 1/8/07, hOURS <[EMAIL PROTECTED]> wrote:
Hi everyone,
Jay offered me the following code to help with something. I don't undertand
it, but tried to use it anyway to see if it would work. The computer told me
there was a syntax error in the area I highlighted in color. I can't find it
- maybe that's because I don't understand the code fully, but if anyone can
show me where it is I'd be grateful.
Thanks,
Fred Kittelmann
Jay Savage <[EMAIL PROTECTED]> wrote:my $timeout = 3600; # 1 hour
eval {
local $SIG{ALRM} = sub { die "longRunningModule timed out\n" };
alarm $timeout;
require longRunningModule;
alarm 0;
}
if ($@) {
if ($@ =~ /timed out/) {
# timeout
} else {
# some other error
}
}
Fred Kittelmann
Fred,
Most people on this list probably don't accept HTML emails from it--I
know I don't--so it's unclear what you highlighted in color.
My guess, though, is that you don't actually have a perl module named
'longRunningModule'. That's just the placeholder the perldoc uses. you
need to replace that with whatever bit of code you're trying to
timeout. The code from the perldoc is generic; you need to make it fit
your situation.
HTH,
-- jay
--------------------------------------------------
This email and attachment(s): [ ] blogable; [ x ] ask first; [ ]
private and confidential
daggerquill [at] gmail [dot] com
http://www.tuaw.com http://www.downloadsquad.com http://www.engatiki.org
values of β will give rise to dom!