gpt4 book ai didi

perl - $@ 和 $! 之间的区别在 perl 中

转载 作者:行者123 更新时间:2023-12-04 02:50:24 26 4
gpt4 key购买 nike

$@有什么区别和 $!在 Perl 中?与 eval 相关的错误使用 $@ 输出. $!也用于捕获错误。那么两者有什么区别呢?

最佳答案

来自 perldoc perlvar :

The variables $@ , $! , $^E , and $? contain information about different types of error conditions that may appear during execution of a Perl program. The variables are shown ordered by the "distance" between the subsystem which reported the error and the Perl process. They correspond to errors detected by the Perl interpreter, C library, operating system, or an external program, respectively.

关于perl - $@ 和 $! 之间的区别在 perl 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17696764/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com