From: Graham Knop Date: Fri, 15 Feb 2019 13:45:00 +0000 (+0100) Subject: inject Distar behavior at import time rather than compile time X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f5cc9f5357fd99a338e42f27eaf1e9d252c4d747;p=p5sagit%2FDistar.git inject Distar behavior at import time rather than compile time --- diff --git a/lib/Distar.pm b/lib/Distar.pm index 1c36b19..fcdc97d 100644 --- a/lib/Distar.pm +++ b/lib/Distar.pm @@ -18,6 +18,10 @@ our @EXPORT = qw( sub import { strict->import; warnings->import(FATAL => 'all'); + if (!(@MM::ISA == 1 && $MM::ISA[0] eq 'Distar::MM')) { + @Distar::MM::ISA = @MM::ISA; + @MM::ISA = qw(Distar::MM); + } shift->export_to_level(1,@_); } @@ -72,8 +76,6 @@ sub write_manifest_skip { { package Distar::MM; - our @ISA = @MM::ISA; - @MM::ISA = (__PACKAGE__); sub new { my ($class, $args) = @_;