Bill Luebkert <> wrote: > Brian Raven wrote: >> >> and "use warnings;" is better >> than -w. > > To the best of my knowledge, use warnings is only *better* in that it > gives you more control than -w. -w should report all warnings (the > same as use warnings 'all') from my reading of docs. If you need to > selectively turn on and off various warnings, that's where use > warnings is more useful.
That sounds like better to me :-) Seriously though, the difference may seem marginal for scripts but 'perldoc perllexwarn' does say "The use warnings pragma is a replacement for both the command line flag -w and the equivalent Perl variable, $^W.". Also, the '-w' on the '#!' line may not be interpreted on all platforms (e.g., IIRC, older versions of perl on win32), in which case you have to remember to put it on the command line. Always starting your scripts with "use warnings" is therefore more certain to enable warnings than "#!perl -w", especially if you expect your scripts to be portable. Its more important for modules, though, as it is the only way of guaranteeing that warnings are enabled, whatever the calling code might do. Personally, I make it a habit to start all perl code with "use strict;" and "use warnings;" (actually I made it a habit for my editor to do that). To be honest, as long as warnings are enabled, I wouldn't quibble too much about how you do it. In retrospect, perhaps "preferable" would have been better than "better" (IYSWIM). HTH -- Brian Raven ========================================= Atos Euronext Market Solutions Disclaimer ========================================= The information contained in this e-mail is confidential and solely for the intended addressee(s). Unauthorised reproduction, disclosure, modification, and/or distribution of this email may be unlawful. If you have received this email in error, please notify the sender immediately and delete it from your system. The views expressed in this message do not necessarily reflect those of Atos Euronext Market Solutions. Atos Euronext Market Solutions Limited - Registered in England & Wales with registration no. 3962327. Registered office address at 25 Bank Street London E14 5NQ United Kingdom. Atos Euronext Market Solutions SAS - Registered in France with registration no. 425 100 294. Registered office address at 6/8 Boulevard Haussmann 75009 Paris France. L'information contenue dans cet e-mail est confidentielle et uniquement destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail vous parvient par erreur, nous vous prions de bien vouloir prevenir l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre systeme. Le contenu de ce message electronique ne represente pas necessairement la position ou le point de vue d'Atos Euronext Market Solutions. Atos Euronext Market Solutions Limited Société de droit anglais, enregistrée au Royaume Uni sous le numéro 3962327, dont le siège social se situe 25 Bank Street E14 5NQ Londres Royaume Uni. Atos Euronext Market Solutions SAS, société par actions simplifiée, enregistré au registre dui commerce et des sociétés sous le numéro 425 100 294 RCS Paris et dont le siège social se situe 6/8 Boulevard Haussmann 75009 Paris France. ========================================= _______________________________________________ ActivePerl mailing list ActivePerl@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs