Loading ...
Sorry, an error occurred while loading the content.

[PBML] Re: Time string parsing

Expand Messages
  • acummingsus
    ... wrote: [ a solution arrives ] Super! (I was a bit confused as I didn t see any code in the post of Shawn s that I received). ... -w and use warnings ? [ .
    Message 1 of 5 , Mar 2, 2006
      --- In perl-beginner@yahoogroups.com, "Damien Carbery" <daymobrew@...>
      [ a solution arrives ]


      (I was a bit confused as I didn't see any code in the post of Shawn's
      that I received).

      > #!/usr/bin/perl -w
      > use Time::Interval;
      > use warnings;

      -w and use warnings ?
      [ . . ]
      > # Note the '%' before the '$' because $diff_time_seconds is a ref.
      > print "Seconds: ", convertInterval( %$diff_time_seconds,
      > 'ConvertTo'=>'seconds'), "\n";


      Returned Data Format

      unless the 'String' option is specified, this routine returns a hash
      reference containing the following data:
      [data snipped]

      (even though no code in Shawn's post I received) I was just about to
      reply saying that it looked like he was accessing a ref to a hash
      rather than dereferencing and getting the hash.

      BTW I think the doc says the default if not specified is seconds
      (which in turn I think makes it optional in this case to have the
      ConvertTo'=>'seconds' parameter). no such parameter
      equates/reverts/uses to the default of seconds (unless I
      mixed_up/transposed something else (something entirely different) and
      it came out (of the brain I guess) as that.

    Your message has been successfully submitted and would be delivered to recipients shortly.