この質問は簡単に見えるかもしれませんが、私はここ数日これについて考えていますが、答えを見つけることができませんでした.
私はマルチレベルのスクリプト アーキテクチャを持っています (コードを以下に示します)。
CallingScript.pl (トップレベル ライブラリをインクルードし、コンパイラ エラーをチェック)
do "IncludesConsumer.pm";
print "\n callingScript error : $@" if($@ || $!);
do "IncludesConsumer.pm";
print "\n callingScript error : $@" if($@);
do "IncludesConsumer.pm";
print "\n callingScript error : $@" if($@);
includesConsumer.pm (ライブラリ INCLUDES.pm を追加し、独自の機能を備えています)
do "INCLUDES.pm";
print "\nin IncludesConsumer";
INCLUDES.pm (複数のモジュールが 1 か所にあり、ライブラリとして機能します)
use Module;
print "\n in includes";
Module.pm (構文エラーあり)
use strict;
sub MakeSyntaxError
{
print "\nerror in Module
}
1;
概念上、コア モジュールの 1 つ (例: Module.pm) に構文エラーが含まれる場合があります。したがって、CallingScript.pl でそれらをキャプチャする必要があります。Module.pm
ie: (低レベル)の構文エラーをファイルにキャプチャしたいと考えていCallingScript.pl
ます。
出力:
D:\Do_analysis>CallingScript.pl
in IncludesConsumer
in IncludesConsumer
in IncludesConsumer
コンパイラ エラーが CallingScript.pl でキャッチされないのはなぜですか? 思いをぶつけてください。
ありがとう!