get hints from strictures as late as possible
[p5sagit/Eval-WithLexicals.git] / t / lib / get_strictures_hints.pm
index f3f36fd..0af3e90 100644 (file)
@@ -1,21 +1,21 @@
 package get_strictures_hints;
 
-local $ENV{PERL_STRICTURES_EXTRA} = 0;
-our $strictures_hints;
-our $strictures_warn;
+sub hints {
+  local $ENV{PERL_STRICTURES_EXTRA} = 0;
+  my $strictures_hints;
+  my $strictures_warn;
 
-eval q{
-  use strictures 1;
-  BEGIN {
-    # Find the hint value that 'use strictures 1' sets on this perl.
-    $strictures_hints = $^H;
-    $strictures_warn = ${^WARNING_BITS};
-  };
-  1;
-} or die $@;
+  eval q{
+    use strictures 1;
+    BEGIN {
+      # Find the hint value that 'use strictures 1' sets on this perl.
+      $strictures_hints = $^H;
+      $strictures_warn = ${^WARNING_BITS};
+    };
+    1;
+  } or die $@;
 
-require Exporter;
-*import = \&Exporter::import;
-our @EXPORT = qw($strictures_hints $strictures_warn);
+  return ($strictures_hints, $strictures_warn);
+}
 
 1;