From: Dagfinn Ilmari Mannsåker Date: Sun, 20 Oct 2013 12:53:36 +0000 (+0100) Subject: Import 'import' instead of inheriting it X-Git-Tag: Try-Tiny-0.19~3^2~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b42071155ac12aeccbb789bdebc756d25726130f;p=p5sagit%2FTry-Tiny.git Import 'import' instead of inheriting it This fixes errors when the first use of Try::Tiny happens during global destruction on Perl >= 5.10.0. The problem is that the inheritance caches don't get invalidated during global destruction, and base.pm skips classes that the calling class already inherits from, thus populating an initial empty inheritance cache, which doesn't get invalidated when it adds the class to @ISA. --- diff --git a/lib/Try/Tiny.pm b/lib/Try/Tiny.pm index f97e9f7..a0e0f10 100644 --- a/lib/Try/Tiny.pm +++ b/lib/Try/Tiny.pm @@ -5,7 +5,7 @@ use 5.006; use strict; use warnings; -use base 'Exporter'; +use Exporter 5.57 'import'; our @EXPORT = our @EXPORT_OK = qw(try catch finally); use Carp;