in reply to Re^2: time::piece Error parsing time at /usr/lib64/perl5/Time/Piece.pm line 469
in thread time::piece Error parsing time at /usr/lib64/perl5/Time/Piece.pm line 469
Thanks poj and choroba. Eval solved it though I wish I understood why. I first tried:
if (eval { $date = Time::Piece->strptime($1, '%m/%d/%Y'); 1 }) {
as poj suggested but this generated the repetitive date 19700101. I tweaked it with:
if (eval { $date = Time::Piece->strptime($&, '%m/%d/%Y'); 1 }) {
and it generated what I had hoped.
I read the docs on eval but I'm still unclear on what problem it resolved.
Thanks again
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: time::piece Error parsing time at /usr/lib64/perl5/Time/Piece.pm line 469
by hippo (Archbishop) on Mar 07, 2018 at 09:01 UTC | |
|
Re^4: time::piece Error parsing time at /usr/lib64/perl5/Time/Piece.pm line 469
by poj (Abbot) on Mar 07, 2018 at 11:04 UTC |