From: Peter Rabbitson Date: Wed, 24 Sep 2014 00:25:20 +0000 (+0200) Subject: More robust Moo import block (modelled on DBIC) X-Git-Tag: v1.79~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=05593cfc9603ed6e7024e10f0df47dd6d8c37222;p=dbsrgits%2FSQL-Abstract.git More robust Moo import block (modelled on DBIC) --- diff --git a/lib/SQL/Abstract/Tree.pm b/lib/SQL/Abstract/Tree.pm index d9b67f9..ecf950d 100644 --- a/lib/SQL/Abstract/Tree.pm +++ b/lib/SQL/Abstract/Tree.pm @@ -5,9 +5,19 @@ package SQL::Abstract::Tree; BEGIN { require warnings; my $initial_fatal_bits = (${^WARNING_BITS}||'') & $warnings::DeadBits{all}; + local $ENV{PERL_STRICTURES_EXTRA} = 0; - require Moo; Moo->import; - require Sub::Quote; Sub::Quote->import('quote_sub'); + # load all of these now, so that lazy-loading does not escape + # the current PERL_STRICTURES_EXTRA setting + require Sub::Quote; + require Sub::Defer; + require Moo; + require Moo::Object; + require Method::Generate::Accessor; + require Method::Generate::Constructor; + + Moo->import; + Sub::Quote->import('quote_sub'); ${^WARNING_BITS} &= ( $initial_fatal_bits | ~ $warnings::DeadBits{all} ); } # END pre-Moo2 import block