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;?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
diagnosticsisn’t a lexical pragma likewarnings. Instead it sets the global$^Wvariable (like using the-wflag), which enables warnings for all code, whether it wants it or not, and whether you wrote it or not. That’s kind of rude.diagnosticsis also silly to use in production. I would recommend usingwarningsand then just piping your warnings tosplainif you need an explanation.