Skip to content
Browse files

stop using INIT block to prevent "Too late to run INIT block" warning

  • Loading branch information...
1 parent ace419c commit f2624f5dd27e0e8fc2cb9bda256aa169e0403ffc @gray gray committed Aug 1, 2009
Showing with 5 additions and 2 deletions.
  1. +3 −0 Changes
  2. +2 −2 lib/Geo/Distance.pm
View
3 Changes
@@ -1,5 +1,8 @@
Revision history for Perl extension Geo::Distance.
+0.14
+ - Stop "Too late to run INIT block" warning (gray <gray@cpan.org>)
+
0.13
- Use Geo::Distance::XS if available. (gray <gray@cpan.org>)
- Declare Math::Trig dependency.
View
4 lib/Geo/Distance.pm
@@ -444,8 +444,8 @@ sub closest {
}
#-------------------------------------------------------------------------------
-INIT {
- eval "use Geo::Distance::XS" unless $ENV{GEO_DISTANCE_PP};
+unless( $ENV{GEO_DISTANCE_PP} ) {
+ eval "use Geo::Distance::XS";
}
1;

0 comments on commit f2624f5

Please sign in to comment.
Something went wrong with that request. Please try again.