X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-File-KDBX;a=blobdiff_plain;f=lib%2FFile%2FKDBX%2FError.pm;h=d4a01b92afde4c0d37c188d985f136b18e2502e2;hp=86442f3bdc306a071a2101cb462e6f3b9dbfbd2b;hb=eefcd42a336641c8927b29d12c5c59443212468f;hpb=cec3705c27fbb9fd9bdfead7103480294b673ed1 diff --git a/lib/File/KDBX/Error.pm b/lib/File/KDBX/Error.pm index 86442f3..d4a01b9 100644 --- a/lib/File/KDBX/Error.pm +++ b/lib/File/KDBX/Error.pm @@ -24,7 +24,7 @@ BEGIN { my $debug = $ENV{DEBUG}; $debug = looks_like_number($debug) ? (0 + $debug) : ($debug ? 1 : 0); - *DEBUG = $debug == 1 ? sub() { 1 } : + *_DEBUG = $debug == 1 ? sub() { 1 } : $debug == 2 ? sub() { 2 } : $debug == 3 ? sub() { 3 } : $debug == 4 ? sub() { 4 } : sub() { 0 }; @@ -147,8 +147,8 @@ sub type { $_[0]->details->{type} // '' } Stringify an error. -This does not contain a stack trace, but you can set the C environment -variable to truthy to stringify the whole error object. +This does not contain a stack trace, but you can set the C environment variable to at least 2 to +stringify the whole error object. =cut @@ -158,7 +158,7 @@ sub to_string { my $self = shift; my $msg = "$self->{trace}[0]"; $msg .= '.' if $msg !~ /[\.\!\?]$/; - if (2 <= DEBUG) { + if (2 <= _DEBUG) { require Data::Dumper; local $Data::Dumper::Indent = 1; local $Data::Dumper::Quotekeys = 0;