From: Matt S Trout Date: Mon, 28 Jan 2008 14:38:18 +0000 (+0000) Subject: comment the strict/warnings hack because I'm bored of being asked about it by people... X-Git-Tag: 0_37~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=86dd5d11b005e4f9bebc55ed868729cd03803069;p=gitmo%2FMoose.git comment the strict/warnings hack because I'm bored of being asked about it by people who didn't think to RTFS strict.pm then look up $^H --- diff --git a/lib/Moose.pm b/lib/Moose.pm index ee92a9b..8b7a166 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -188,6 +188,11 @@ use Moose::Util (); sub import { $CALLER = _get_caller(@_); + # this works because both pragmas set $^H (see perldoc perlvar) + # which affects the current compilation - i.e. the file who use'd + # us - which is why we don't need to do anything special to make + # it affect that file rather than this one (which is already compiled) + strict->import; warnings->import; diff --git a/lib/Moose/Role.pm b/lib/Moose/Role.pm index c07dc5e..67347a3 100644 --- a/lib/Moose/Role.pm +++ b/lib/Moose/Role.pm @@ -154,6 +154,10 @@ use Moose::Util::TypeConstraints; && defined $_[1]->{into_level} ? caller( $_[1]->{into_level} ) : caller(); + # this works because both pragmas set $^H (see perldoc perlvar) + # which affects the current compilation - i.e. the file who use'd + # us - which is why we don't need to do anything special to make + # it affect that file rather than this one (which is already compiled) strict->import; warnings->import;