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. }