From: Jos I. Boumans Date: Sat, 7 Feb 2009 13:32:56 +0000 (+0100) Subject: Update Module::Load to 0.16 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=26f467e271edd98e360d6fde88d670d7a659f513;p=p5sagit%2Fp5-mst-13.2.git Update Module::Load to 0.16 This is a mere test-suite tweak to work around a bug in perl 5.8.[45], but submitted to keep CPAN & core in sync. --- diff --git a/lib/Module/Load.pm b/lib/Module/Load.pm index 2011955..08f64b2 100644 --- a/lib/Module/Load.pm +++ b/lib/Module/Load.pm @@ -1,6 +1,6 @@ package Module::Load; -$VERSION = '0.14'; +$VERSION = '0.16'; use strict; use File::Spec (); diff --git a/lib/Module/Load/t/to_load/TestModule.pm b/lib/Module/Load/t/to_load/TestModule.pm index bc18a03..ffc5ec9 100644 --- a/lib/Module/Load/t/to_load/TestModule.pm +++ b/lib/Module/Load/t/to_load/TestModule.pm @@ -9,7 +9,19 @@ use vars qw(@EXPORT @EXPORT_OK @ISA $IMPORTED); @EXPORT_OK = qw(func1); ### test if import gets called properly -sub import { $IMPORTED = 1; goto &Exporter::import; } +sub import { $IMPORTED = 1; + ### this breaks on 5.8.[45] which have a bug with goto's losing + ### arguments in @_. This is the cause of the 0.14 tester failures + ### under 5.8.[45]. The bug is NOT in exporter, but core perl: + ### http://testers.cpan.org/show/Module-Load.html + #goto &Exporter::import; + + ### instead, use the undocumented, but widely used $ExportLevel + ### which will make sure we pass all arguments, and even works + ### on buggy 5.8.[45] + do { local $Exporter::ExportLevel += 1; Exporter::import(@_) } + } + sub imported { $IMPORTED; } sub func1 { return "func1"; }