in reply to Error parsing using Time::Piece
Updating Time::Piece to 1.29 is not the problem. I get the same error under 1.27.
$ perl -MTime::Piece -E 'say $Time::Piece::VERSION' 1.27 $ perl -MPOSIX=strftime -MTime::Piece -E ' say strftime q{%FT%T}, loca +ltime; Time::Piece->strptime( strftime(q{%FT%T}, localtime), q{%FT%T} +);' 2015-04-29T04:18:23 Error parsing time at /Users/ken/perl5/perlbrew/perls/perl-5.20.2t/lib +/5.20.2/darwin-thread-multi-2level/Time/Piece.pm line 469.
The error message includes a pathname to the file and a line number. Had you viewed that file and gone to line 469, you would have seen that line is in sub strptime and, just a few lines above, you see sub strftime (sound familiar?).
Looking at the Time::Piece documentation, you'll see that Time::Piece::strftime is the "same as POSIX::strftime (without the overhead of the full POSIX extension)".
To fix, the easiest would be to remove the POSIX references. If, for some reason, that's not possible (I've no idea what your real code looks like), you'll need to be specific about which strftime you mean, i.e. POSIX::strftime or Time::Piece::strftime.
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Error parsing using Time::Piece
by Anonymous Monk on Apr 28, 2015 at 18:48 UTC | |
by jeffa (Bishop) on Apr 28, 2015 at 18:54 UTC | |
by Anonymous Monk on Apr 28, 2015 at 19:05 UTC |