>Having been a Perl programmer for several years now I have become
>accustom to using the following as my normal "start" of any Perl script:
>
>#!/usr/bin/perl
>use warnings;
>use strict;
>
>Randal Schwartz uses this:
>
>    #!/usr/bin/perl -w
>    use strict;
>    $|++;
>
>Is there any difference between the -w and "use warnings" declaration?
>I know that both turn on warnings and the -w is commonly used at the
>command line, but was just curious as to if one was "better" than the other.

"use warnings" only exists in Perl 5.004_05 or later. If you want your
scripts to work in Perl interpreters earlier than that (the still prevalent
5.004_04), then you'll need to use "-w". Note: I may be slightly "what crack
is he smoking?" on my version numbers - it's been a while.

I prefer "use warnings" myself - people
really should try their damndest to update.

As for $|++, there was a recent debate (on Perlmonks.com, I believe) on how
$|=1 may be a better visual choice than $|++. I haven't made up my mind
either way - I still use ++ in my own scripts. Unfortunately, I couldn't
find the Perlmonks.com link, so I may have just dreamt this.


-- Morbus Iff ( i put the demon back in codemonkey ) Culture: http://www.disobey.com/ and http://www.gamegrene.com/ Buy My Book! http://amazon.com/exec/obidos/ASIN/0596004605/disobeycom icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to