Brian Raven wrote: > 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).
That was my point - the -w did turn on all warnings, so in the case at hand it was just as good as the use version. As far as preferable, on Win32, it would be preferable if you needed some of the additional functionality it provides. The word you might want to use is more versatile. _______________________________________________ ActivePerl mailing list ActivePerl@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs