gpt4 book ai didi

perl - 如何禁用警告?

转载 作者:行者123 更新时间:2023-12-03 22:53:11 25 4
gpt4 key购买 nike

我有警告:

"my" variable $subject masks earlier declaration in same scope at ...

我知道我可以通过 no warnings 'all' 禁用警告pragma,但找不到 right category对于我的警告类型。

如何仅禁用此类警告?

最佳答案

搜索 perldoc perldiag 为您的警告信息。这个turns up

"%s" variable &%s masks earlier declaration in same %s

(W shadow) A "my", "our" or "state" variable has been redeclared in the current scope or statement, effectively eliminating all access to the previous instance. This is almost always a typographical error. Note that the earlier variable will still exist until the end of the scope or until all closure references to it are destroyed.


它告诉您禁用此特定警告的编译指示是
no warnings 'shadow';

关于perl - 如何禁用警告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61030447/

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