From: Peter Rabbitson Date: Mon, 29 Feb 2016 11:50:54 +0000 (+0100) Subject: (optdep) last-from-block is a compile-time warning, silence properly X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dbfb29f0609a5eef347d81b8fdb9b7cce222970f;p=dbsrgits%2FDBIx-Class.git (optdep) last-from-block is a compile-time warning, silence properly Without this we do get warnings under RELEASE_TESTING=1 as warnings are then enabled file-wide --- diff --git a/lib/DBIx/Class/Optional/Dependencies.pm b/lib/DBIx/Class/Optional/Dependencies.pm index a7ab5e5..786828a 100644 --- a/lib/DBIx/Class/Optional/Dependencies.pm +++ b/lib/DBIx/Class/Optional/Dependencies.pm @@ -861,7 +861,9 @@ sub skip_without { if ( my $err = $self->req_missing_for($groups) ) { my ($fn, $ln) = (caller(0))[1,2]; $tb->skip("block in $fn around line $ln requires $err"); - local $^W = 0; + + BEGIN { ${^WARNING_BITS} = "" } + last SKIP; }