Permalink
Browse files

Avoid a warning if the CHECK block can not be run

  • Loading branch information...
1 parent ebc8455 commit b40d0026c926c320ad42c20a09d86e72885a443e @dolmen committed Aug 23, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/Exporter/Lazy.pm
View
@@ -54,6 +54,11 @@ sub _import
goto &Exporter::import;
}
+{
+# The CHECK block may never run if the module is loaded at runtime instead of
+# at BEGIN time. So we must do only optional checks here, and we want to
+# avoid the warning as we are aware of the issue.
+no warnings 'void';
CHECK {
no strict 'refs';
@@ -81,7 +86,7 @@ CHECK {
}
}
}
-
+}

0 comments on commit b40d002

Please sign in to comment.