[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

RE: lexical warnings upgrade



I've had a closer look at the list of core library files that make use of
$^W and I've included a patch to make some of them use lexical warnings
instead.

These are the ones I changed (I don't think any of these are a parallel
existence on CPAN).

    lib/Cwd.pm
    lib/English.pm
    lib/ExtUtils/MM_Unix.pm
    lib/ExtUtils/Manifest.pm
    lib/Fatal.pm
    lib/File/Glob.pm
    lib/Math/BigFloat.pm
    lib/Text/ParseWords.pm
    lib/utf8_heavy.pl

These are on CPAN so I didn't touch them

    lib/CGI/Carp.pm
    lib/CGI.pm
    lib/CPAN/FirstTime.pm
    lib/CPAN.pm
    lib/IO/Select.pm

These use $^W to see if warnings were enabled and to display a warning
message themselves. More about this at the end.

    lib/Class/Struct.pm
    lib/Exporter/Heavy.pm
    lib/Socket.pm
    lib/Tie/Handle.pm
    lib/Tie/Hash.pm
    lib/Tie/Scalar.pm
    lib/fields.pm
    lib/syslog.pl
    lib/vars.pm                             

For example this is 

  carp "WARNING: calling ${pkg}->new since ${pkg}->TIESCALAR is missing"
        if $^W;  
  
I didn't have time to check whether these were controlling warnings from
a distance so I've left well alone

    lib/DB.pm
    lib/Dumpvalue.pm
    lib/Test.pm
    lib/diagnostics.pm
    lib/dumpvar.pl
    lib/perl5db.pl

These actually enable $^W. Anyone know why?

    lib/ExtUtils/MM_Win32.pm
    lib/ExtUtils/MakeMaker.pm
    lib/File/Spec/Win32.pm
    lib/I18N/Collate.pm

Back to the modules that use $^W to determine whether to print a
module-specific warning. The idiom

    warn "that isn't quite right" if $^W

won't work if a lexical warnings are enabled in the scope that has called
the module. What is needed is a way for a module to determine what the
warnings settings are at the point it was called.

Paul

begin 664 lex.gz
M'XL("#IXDS@"`VQE>`#=6'MSV[@1_UO^%!N+#25'XIN41=6-7=>YR4V=>O*X
M3"=.-+0(B:SY"@E:5C/^[EV`I$12C\GU;M*;<BB1Q#X`[/X6V$47WGM^!G@[
MD#ATYL$\3B$A:6!*BF).+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