From e8e1363e4770ff29f5c2721318de9eb8fd7c8a22 Mon Sep 17 00:00:00 2001 From: Charles McGarvey Date: Wed, 27 Apr 2022 13:34:18 -0600 Subject: [PATCH] Fix extends to die on failure --- lib/File/KDBX/Iterator.pm | 2 ++ lib/File/KDBX/Util.pm | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) 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; } -- 2.45.2