use warnings; and use Warnings; give different results

From: Ted Sung (teds_at_intex.com)
Date: 08/30/04


Date: 30 Aug 2004 13:09:03 -0700

D:\perl_scripts>perl -v
This is perl, v5.6.1 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)

I have the following simple/trivial script, test.pl:

use strict;
use Warnings;
use Cwd;

When I run this as perl -w test.pl, I get the following:

D:\perl_scripts>perl -w test2.pl
Subroutine bits redefined at d:/perl/lib/warnings.pm line 285.
Subroutine import redefined at d:/perl/lib/warnings.pm line 304.
Subroutine unimport redefined at d:/perl/lib/warnings.pm line 314.
Subroutine __chk redefined at d:/perl/lib/warnings.pm line 325.
Subroutine enabled redefined at d:/perl/lib/warnings.pm line 373.
Subroutine warn redefined at d:/perl/lib/warnings.pm line 386.
Subroutine warnif redefined at d:/perl/lib/warnings.pm line 400.

Strangely, if I change the upper case 'W' to w so the script is like
this:

use strict;
use warnings;
use Cwd;

I don't see these warnings.

Also, if I remove the 'use Cwd;' line, I don't get any warnings
regardless of the case of 'W'.

What is going on here?

Thanks,

Ted



Relevant Pages

  • Re: Newbie questions, migrating from c++
    ... > to get no warnings using SEEK_SET etc, ... So if I'm to do something with chars in string (or perl ... It is not a good idea to use this method of subroutine invocation unless ... sub no_need { ...
    (comp.lang.perl.misc)
  • Re: Reference to loop index in a closure
    ... > Each subroutine is intended to print the value of the loop index ... > when it (the subroutine) was created. ... > use warnings; ... This is perl, v5.8.3 built for MSWin32-x86-multi-thread ...
    (comp.lang.perl.misc)
  • =?iso-8859-1?q?Re:_Einer_Subroutine_2_Hashes_=FCbergeben?=
    ... Aber wenn ich eine Subroutine schreibe, ... glücklicherweise jeder post FORTRAN Programmierer "call by ... "You may still declare a sub just as you did in Perl 5, ...
    (de.comp.lang.perl.misc)
  • Re: Perl Multithreading and use of Perl Modules
    ... >> I'm trying to create a multithreaded program in Perl 5.8 on Linux. ... The tracker() subroutine needs to be able to check the shared variables ...
    (comp.lang.perl.misc)
  • Re: Einer Subroutine 2 Hashes =?ISO-8859-1?Q?=FCbergeben?=
    ... > die Zuweisung im Funktionsaufruf völlig" dieselbe Semantik? ... > einen Ausdruck) an eine Subroutine übergibst, ... Die "Referenz" kann ja auch weitergereicht werden. ... Die von Perl gebotene Möglichkeit, ...
    (de.comp.lang.perl.misc)