Perl的

系统教程 行业动态 更新时间:2024-06-14 16:57:39
Perl的-w开关在5.6.x之后不推荐使用警告吗?(Is Perl's -w switch for warnings deprecated after 5.6.x?)

我在Simon Cozens的书“Beginning Perl”中读到了-w切换警告将会被弃用。 这是真的还是可以继续使用-w而不是“使用警告”。

I read in Simon Cozens' book "Beginning Perl" that -w switch for warnings would be deprecated going forward. Is this true or is it still ok to continue using -w rather than "use warnings".

最满意答案

perlrun文档(请参阅perldoc perlrun或本页 )表示从Perl 5.12.2开始,-w选项仍然可用。 使用编译指示可以获得很多好处,例如在词法和细粒度警告中转变警告。

这里有一个关于为什么你应该使用编译指示而不是命令行选项的简介。

The perlrun documentation (see perldoc perlrun or this page) indicates that the -w option is still available as of Perl 5.12.2. Using the pragma gets you nifty benefits though, like turning warnings on lexically and finer grained warnings.

Here is a blurb on why you should use the pragma instead of the command line option.

更多推荐

本文发布于:2023-04-13 12:02:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/d0e7c2c1c52322cb7a972b9364394b96.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Perl

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!