From: Mischa POSLAWSKY Date: Sat, 31 May 2008 21:09:47 +0000 (+0000) Subject: disable warnings within PLP::Script X-Git-Tag: 3.21~3 X-Git-Url: http://git.shiar.net/perl/plp/.git/commitdiff_plain/01ce7b8943ff0c25365916e0a2e355d06b3efc9a disable warnings within PLP::Script 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. --- diff --git a/lib/PLP.pm b/lib/PLP.pm index b9e3b7e..a470b52 100644 --- a/lib/PLP.pm +++ b/lib/PLP.pm @@ -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; diff --git a/lib/PLP/Functions.pm b/lib/PLP/Functions.pm index 627d390..c298dca 100644 --- a/lib/PLP/Functions.pm +++ b/lib/PLP/Functions.pm @@ -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);