laziness, impatience, and hubris | |
PerlMonks |
Re^3: Shebang behavior with perl (-w)by tye (Sage) |
on Mar 02, 2015 at 18:33 UTC ( [id://1118451]=note: print w/replies, xml ) | Need Help?? |
Well, that situation was part of the motivation for the creation of "use warnings". But, I find that this motivation mostly no longer applies and that "use warnings" has its own problems and those are now worse than the problems of "-w" in most environments that I encounter. For example, it is fairly common to work in a manner where treating undef as either 0 or the empty string is not a problem. In such an environment, I don't enable warnings. But if I use a "modern" module, then it will have turned on warning for itself. When I pass one of these undefs into that module, I'll likely get a warning when the module tries to use that value as a string or as a number. So, in that case, "use warnings" causes the exact same problem as the one you claim I should avoid by using it. So I have better luck making sure that I always use "-w" in module tests and that I enable warnings in run-time environments where the warnings won't be useless (or worse). It has been a very long time since I ran into a problem with a module producing unwanted warnings due to my use of "-w". It has not been a long time since I've seen unwanted warnings from "use warnings" in a module. - tye
In Section
Seekers of Perl Wisdom
|
|