in reply to Error reading line from file: Operation timed out
First of all you should improve your error handling. Checking -e after a failed open is prone to race conditions, and there are other reasons why an open could fail. Try something along these lines:
my $isOpen = open($handle, $templateLocation); if (!$isOpen) { my $exception = MidTier::Exception->new("2", "Error opening file `$templateLocation' for reading: $!", +$self); # no need to close never opened handles $exception->sendLog(); die; # unless $exception->sendlog() dies anyway } $logger->debug("File $templateLocation opened"); $logger->info("Building template: $template");
Then note that if (!$line test dangerous - what if a line is a false value for perl? (ie a 0 without a newline after it).
(Another stupid idea from me: maybe the template file just lives on a network file system, and the connection hangs, and that's why you're getting timeouts?)
|
|---|