nirvan1001 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I'm having some problem while executing the following code:
use Time::Piece::ISO; my $t = Time::Piece::ISO->strptime('2002-04-25T21:17:52'); print LOG "Time is $t\n"; # prints "Time is 2002-04-25T21:17:52"
I get a parser error. As per the module it should print "Time is 2002-04-25T21:17:52". The CPAN module is at http://search.cpan.org/~dwheeler/Time-Piece-ISO-0.10/lib/Time/Piece/ISO.pm
It should execute the strptime method overwritten in Time::Piece::ISO but it's executing the base class method in Time::Piece. I've installed both Time::Piece::ISO and Time::Piece using ppm in my machine...not sure what's wrong...
Any idea ?
thanks
Nirvan

Replies are listed 'Best First'.
Re: Parsing error in Time::Piece::ISO
by Tanktalus (Canon) on Dec 02, 2005 at 00:23 UTC

    I installed Time::Piece::ISO, copied that into a file, removed the LOG, and it worked fine.

    Thus, the question is: what is the exact code you're using, and what is the exact error message you're seeing?

      Sorry I was logging the print, hence forgot to remove the 'LOG' from the code snippet. Here is the exact code:
      use Time::Piece::ISO; my $t = Time::Piece::ISO->strptime('2002-04-25T21:17:52'); print "Time is $t\n";
      The error message is:
      Error parsing time at C:/Perl/site/lib/Time/Piece.pm line 442. at C:/Perl/site/lib/Time/Piece.pm line 442