X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=lib%2FFile%2FKDBX%2FUtil.pm;h=a27f4dd70393a4d9aaa21c68d5f39cb9e32f8517;hb=796fdad82448b51f9c990ca461df647341a84b7e;hp=9c4e6f63cea884dcde6fd14e2e4a51c45fcdd51c;hpb=8ccefe1cedea9b0886a44ad096aa5710528eaac7;p=chaz%2Fp5-File-KDBX diff --git a/lib/File/KDBX/Util.pm b/lib/File/KDBX/Util.pm index 9c4e6f6..a27f4dd 100644 --- a/lib/File/KDBX/Util.pm +++ b/lib/File/KDBX/Util.pm @@ -231,6 +231,10 @@ sub clone_nomagic { return $thing; } +=func DEBUG + +Constant number indicating the level of debuggingness. + =func dumper $str = dumper $thing; @@ -681,7 +685,7 @@ The logic can be specified in a manner similar to L for examples. +See L for examples. =cut @@ -712,8 +716,8 @@ sub query_any { $size = read_all($fh, my $buffer, $size); $size = read_all($fh, my $buffer, $size, $offset); -Like L but returns C if not all C<$size> bytes are read. This is considered an error, -distinguishable from other errors by C<$!> not being set. +Like L but returns C if not all C<$size> bytes are +read. This is considered an error, distinguishable from other errors by C<$!> not being set. =cut @@ -901,7 +905,8 @@ sub to_number { $_[0] // return; 0+$_[0] } sub to_string { $_[0] // return; "$_[0]" } sub to_time { $_[0] // return; - return gmtime($_[0]) if looks_like_number($_[0]); + return scalar gmtime($_[0]) if looks_like_number($_[0]); + return scalar gmtime if $_[0] eq 'now'; return Time::Piece->strptime($_[0], '%Y-%m-%d %H:%M:%S') if !blessed $_[0]; return $_[0]; }