comment the strict/warnings hack because I'm bored of being asked about it by people...
Matt S Trout [Mon, 28 Jan 2008 14:38:18 +0000 (14:38 +0000)]
lib/Moose.pm
lib/Moose/Role.pm

index ee92a9b..8b7a166 100644 (file)
@@ -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;
 
index c07dc5e..67347a3 100644 (file)
@@ -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;