With perl I almost always use:
use strict;
use diagnostics;
I suggested "use diagnostics" instead of use warnings;
here and I received some negative feedback. So, now I'm thinking:
Is there any problem with use diagnostics;
?
diagnostics
isn't a lexical pragma like warnings
. Instead it sets the global $^W
variable (like using the -w
flag), which enables warnings for all code, whether it wants it or not, and whether you wrote it or not. That's kind of rude. diagnostics
is also silly to use in production. I would recommend using warnings
and then just piping your warnings to splain
if you need an explanation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With