我在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.
更多推荐
发布评论