X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=lib%2FFile%2FKDBX%2FIO.pm;h=4d6009ddf84e84734fecb931523dd531d4758fae;hb=HEAD;hp=0ea5d9cd665a0fc4a8c52ae08657680e921aaa0d;hpb=50f1a929d9224b9072b5fae39162a5d943323c5d;p=chaz%2Fp5-File-KDBX diff --git a/lib/File/KDBX/IO.pm b/lib/File/KDBX/IO.pm index 0ea5d9c..4d6009d 100644 --- a/lib/File/KDBX/IO.pm +++ b/lib/File/KDBX/IO.pm @@ -5,13 +5,14 @@ use warnings; use strict; use Devel::GlobalDestruction; -use File::KDBX::Util qw(:empty :bool); +use File::KDBX::Constants qw(:bool); +use File::KDBX::Util qw(:class :empty); use List::Util qw(sum0); use Ref::Util qw(is_blessed_ref is_ref is_scalarref); use Symbol qw(gensym); use namespace::clean; -use parent 'IO::Handle'; +extends 'IO::Handle'; our $VERSION = '999.999'; # VERSION @@ -43,6 +44,7 @@ sub new { sub DESTROY { return if in_global_destruction; + local ($., $@, $!, $^E, $?); my $self = shift; $self->close; } @@ -366,7 +368,7 @@ if ($ENV{DEBUG_IO}) { my $indented_method = (' ' x $debug{level}) . $method; my $self = shift; print STDERR sprintf('%-20s -> %s (%s)', $indented_method, $self, - join(', ', map { defined ? substr($_, 0, 16) : 'undef' } @_)), "\n"; + join(', ', map { defined $_ ? substr($_, 0, 16) : 'undef' } @_)), "\n"; my $r = $orig->($self, @_) // 'undef'; print STDERR sprintf('%-20s <- %s [%s]', $indented_method, $self, $r), "\n"; return $r;