From: Charles McGarvey Date: Wed, 27 Apr 2022 19:34:18 +0000 (-0600) Subject: Fix extends to die on failure X-Git-Tag: v0.800~10 X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=e8e1363e4770ff29f5c2721318de9eb8fd7c8a22;p=chaz%2Fp5-File-KDBX Fix extends to die on failure --- diff --git a/lib/File/KDBX/Iterator.pm b/lib/File/KDBX/Iterator.pm index 8d79b2a..f661706 100644 --- a/lib/File/KDBX/Iterator.pm +++ b/lib/File/KDBX/Iterator.pm @@ -7,9 +7,11 @@ use strict; use File::KDBX::Error; use File::KDBX::Util qw(:class :load :search); use Iterator::Simple; +use Module::Loaded; use Ref::Util qw(is_arrayref is_coderef is_scalarref); use namespace::clean; +BEGIN { mark_as_loaded('Iterator::Simple::Iterator') } extends 'Iterator::Simple::Iterator'; our $VERSION = '999.999'; # VERSION diff --git a/lib/File/KDBX/Util.pm b/lib/File/KDBX/Util.pm index a09d286..5b12e9d 100644 --- a/lib/File/KDBX/Util.pm +++ b/lib/File/KDBX/Util.pm @@ -411,8 +411,7 @@ Set up the current module to inheret from another module. sub extends { my $parent = shift; my $caller = caller; - # load $parent; - eval qq[require $parent]; + load $parent; no strict 'refs'; ## no critic (ProhibitNoStrict) @{"${caller}::ISA"} = $parent; }