in reply to Re: Trying to find and copy mp3s
in thread Trying to find and copy mp3s

This is the second time in recent days that I have seen use warnings suggested to someone whose code already included #!/usr/bin/perl -w. I have long been under the impression that the -w switch is equivalent to use warnings. (man perlrun states that -w "prints warnings about dubious constructs" and "really just enables the internal $^W variable", but does not explictly describe its relation to use warnings.)

Is there an actual, functional difference between the two? If not, why the suggestion that both should be used?

Replies are listed 'Best First'.
Re^3: Trying to find and copy mp3s
by davorg (Chancellor) on Feb 12, 2007 at 16:17 UTC
Re^3: Trying to find and copy mp3s
by kyle (Abbot) on Feb 12, 2007 at 15:53 UTC

    I don't know of any functional difference. I just didn't notice the -w in the OP. In my own code, I always have both:

    use strict; use warnings;
    ...just like that at the top of every file. It's such a strong habit that when I see just one of them, I think the other is missing.

    Anyway, my mistake. Thanks for pointing it out.

      OK, fair enough. I just wanted to be sure there wasn't some difference I was missing by habitually using only -w.
Re^3: Trying to find and copy mp3s
by MidLifeXis (Monsignor) on Feb 12, 2007 at 18:48 UTC