De-retardize XS-less behavior under SpeedyCGI
[p5sagit/Devel-GlobalDestruction.git] / lib / Devel / GlobalDestruction.pm
index f807d0e..dc7be3f 100644 (file)
@@ -3,7 +3,7 @@ package Devel::GlobalDestruction;
 use strict;
 use warnings;
 
-our $VERSION = '0.04';
+our $VERSION = '0.05';
 
 use Sub::Exporter -setup => {
     exports => [ qw(in_global_destruction) ],
@@ -21,6 +21,14 @@ elsif (eval {
     # the eval already installed everything, nothing to do
 }
 else {
+
+  # SpeedyCGI runs END blocks every cycle but somehow keeps object instances
+  # hence DIAF
+  die("The pure-perl version of @{[__PACKAGE__]} can not function correctly under CGI::SpeedyCGI. "
+    . "Please ensure you have a working compiler, and reinstall @{[__PACKAGE__]} to enable the XS "
+    . "codepath.\n"
+  ) if $CGI::SpeedyCGI::i_am_speedy;
+
   eval <<'PP_IGD' or die $@;
 
 my ($in_global_destruction, $before_is_installed);
@@ -28,9 +36,7 @@ my ($in_global_destruction, $before_is_installed);
 sub in_global_destruction { $in_global_destruction }
 
 END {
-  # SpeedyCGI runs END blocks every cycle but somehow keeps object instances
-  # hence lying about it seems reasonable...ish
-  $in_global_destruction = 1 unless $CGI::SpeedyCGI::i_am_speedy;
+  $in_global_destruction = 1;
 }
 
 # threads do not execute the global ENDs (it would be stupid). However
@@ -113,12 +119,6 @@ current value of C<PL_dirty>.
 
 =back
 
-=head1 VERSION CONTROL
-
-This module is maintained using Darcs. You can get the latest version from
-L<http://nothingmuch.woobling.org/code>, and use C<darcs send> to commit
-changes.
-
 =head1 AUTHORS
 
 Yuval Kogman E<lt>nothingmuch@woobling.orgE<gt>