I played about with the eval code and some of the code from the docs (which I had previously rejected) and for some reason, the following actually works:
foreach $j (@j) { print "Next Loop $j \n"; eval { local $SIG{ALRM} = sub { die "Alarm\n"; }; alarm(2); &callfc(); }; if ($@) { die unless $@ eq "Alarm\n"; # timed out } else { # didn't print "Didnt\n"; } } print "I am continuing with the code\n";
Does anyone have an explanation as to why this works and the next if above does not. Logically it should.
Kakaze
In reply to Re: Re: GOTO, Signals and Win32
by kakaze
in thread GOTO, Signals and Win32
by kakaze
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |