Perl.Org wrote:
Gunnar Hjalmarsson wrote:
If you have made your scripts pass $^W (or the -w switch) without
generating warnings, you obviously don't need the flexibility
that "use warnings;" may offer, so there is really no need to
replace $^W with "use warnings;" just because Perl is upgraded.

Actually I've just started adding $^W to my scripts and modules and haven't seen any warnings yet.

Then you are either a very good coder, or you are missing something. ;-)

What could I insert to generate a warning?

An example:

    my $var;
    if ($var < 5) {
        print "$var is less than 5\n";
    }

That code should trigger two common warning messages:

    "Use of uninitialized value in numeric lt («)"

and

    "Use of uninitialized value in concatenation (.) or string"

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to