On Mar 8, 2009, at 1:29 PM, Ron Bergin wrote:
#!/usr/bin/perl -wIt's better to use the warnings pragma, instead of the -w switch
Another note on this... I just perldoc'ed it to see what it had to say: DESCRIPTIONThe "warnings" pragma is a replacement for the command line flag "−w", but the pragma is limited to the enclosing block, while the flag is
global. See perllexwarn for more information.If the pragma is limited to the enclosing block but the flag is global *AND* it is considered best practice to remove the pragma when distributing your program:
ote that it may still be appropriate to comment out the use warnings line when your application or module is deployed, especially if non- technical users will interact with it, or if it will run in a CGI or other embedded environment. Issuing warnings in these contexts can needlessly alarm users, or cause server errors.
Don't remove the use warnings completely, though; when something goes wrong, you'll want to uncomment it again so the reinstated warnings can help you locate and fix the problem.
I am failing to see where this would be preferable except in the case of also using the "use English" pragma or many of the other options that would be limited to the enclosing block.
How do you see that topic? --jms
PGP.sig
Description: This is a digitally signed message part