Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
$SIG{__WARN__}ハンドラーがあります。それが明示的なwarn呼び出しの結果として呼び出されたのか、Perlによって生成された警告の結果として呼び出されたのか(たとえば、未定義の変数を使用して)を判断する方法はありますか?
$SIG{__WARN__}
warn
次のように、警告メッセージがハンドラに渡されます。
$SIG{__WARN__} = sub { my $warning = shift; #do something with warning. }