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");