For one, it's nice to have a symmetry between the way you enable
warnings ('use warnings;') and the way you temporarily disable
warnings ('no warnings').
Oh, and I thought you just said local $^W = 0;
For two, -w is global. It enables warnings in every script, everything
that's been require()'d or use'd.
Isn't that a good thing?
If you're using a module which is for some reason not
warnings-compliant,
<shock> You mean people still develop code without warnings?! </shock>
<confusion> How do they ensure their code works before releasing it? </confusion>
-w will report the warnings in a module that you have no control over.
Is there such a thing as a module you have no control over?
Surely I could just hack a copy of it and use lib?
use warnings; only reports them in your own script.
That's clever, I wonder how it does that. Just a minute while I
reach in my standard library... It's not there! My version of
perl has no warnings.pm! If I grabbed a copy of warnings.pm from
elsewhere, would it necessarily work on my version of perl:
version 5.005_03 built for arm-riscos?
If you're tempted to tell me to upgrade, I don't have that luxury.
The original porter of perl to RISC OS has lost interest in keeping
it up to date so I'm stuck with 5.005_03.