The program is around 10,000 lines and I don't know exactly which part of it is the culprit.
Perhaps a few debug statements with time stamps in a log file would help
sub logger{
$time=localtime();
print LOGFILE "$time : @_\n";
}
sub parseElement{
logger("I am in UR parseElement starting");
...
that way you should be able to isolate where the issue arises | [reply] [d/l] |
Is it possible that XP is hibernating or going into standby?
Are other applications affected at the same time?
| [reply] |
Perhaps you could add a sig handler to your code. Something like the sig handler here:
#!
use Carp;
use strict;
use warnings;
$SIG{INT}=\&CtrlC;
sub CtrlC {
$SIG{INT}=\&CtrlC;
Carp::carp('Caught a CTRL/C');
};
sub mySub {
for (1..10) {
<STDIN>;
};
};
for (1..10) {
<STDIN>;
};
mySub();
exit;
When it hangs again, just give it a ctrl/c and see where it carps from. | [reply] [d/l] |
vroom: That was quite helpful. However, in Perl 5.8.8 in Windows environment, any attempt to override SIGINT or SIGBREAK will be ignored. Furthermore, my program communicates with another interface, which is old, and must be installed on Perl 5.8.8 to work. I can't upgrade my Perl version to 5.10.0.
Anyway, the whole program is actually running within a huge Event-1.10 loop. I've setup a test environment with Perl 5.10.0 installed to experiment with your suggestion, and was letdown when Carp merely reports that CTRL/C was caught at this line:
Event::loop;
| [reply] [d/l] |