disable warnings within PLP::Script
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 31 May 2008 21:09:47 +0000 (21:09 +0000)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 31 May 2008 21:35:03 +0000 (21:35 +0000)
d9f3acb221a71e094318c7b5d3809aa81dbb5bb3 (use warnings in all modules)
would not only enable warnings in plp modules, but also users' code
evalled within.  Obviously not a nice thing to do.

lib/PLP.pm
lib/PLP/Functions.pm

index b9e3b7eef5c4ab59b01044c6aba37f6dd0732b49..a470b520381ca77588c8517e35988325271bda42 100644 (file)
@@ -239,10 +239,10 @@ sub start {
 
                # No lexicals may exist at this point.
                
-               eval qq{ package PLP::Script; $PLP::code; };
+               eval qq{ package PLP::Script; no warnings; $PLP::code; };
                PLP::error($@, 1) if $@ and $@ !~ /\cS\cT\cO\cP/;
 
-               eval   { package PLP::Script; $_->() for reverse @PLP::END };
+               eval   { package PLP::Script; no warnings; $_->() for reverse @PLP::END };
                PLP::error($@, 1) if $@ and $@ !~ /\cS\cT\cO\cP/;
        }
        PLP::sendheaders() unless $PLP::sentheaders;
index 627d39071d0e99e15da7212e6c5d44965130794d..c298dca0d37d821ece7f12d6370974f302678bcb 100644 (file)
@@ -16,7 +16,7 @@ sub Include ($) {
        $PLP::inA = 0;
        $PLP::inB = 0;
        local $@;
-       eval 'package PLP::Script; ' . PLP::source($PLP::file, 0, join ' ', (caller)[2,1]);
+       eval 'package PLP::Script; no warnings; ' . PLP::source($PLP::file, 0, join ' ', (caller)[2,1]);
        if ($@) {
                PLP::Functions::exit() if $@ =~ /\cS\cT\cO\cP/;
                PLP::error($@, 1);