develooper Front page | perl.perl5.porters | Postings from August 2012

Time::localtime lvalue accessors

Thread Next
Paul LeoNerd Evans
August 29, 2012 16:04
Time::localtime lvalue accessors
Message ID:
I would love to be able to write:

  use Time::localtime;

  my $t = localtime;
  $t->mday += 3;
  return $t->mktime;

To do this, this requires:

  * lvalue accessors on Time::localtime / Time::gmtime objects
  * A mktime method
     + also if this was added, a timegm method would be nice too ;)

These would simplify a lot of time/date manipulation operations.


Purely as an implementation note, these could be implemented by some
lazy generation/caching in methods and so on, but that's implementation.
I care more about the interface.

Would anyone object if I sent a patch to supply this? I'm quite sure it
isn't at all hard to write.

Paul "LeoNerd" Evans
ICQ# 4135350       |  Registered Linux# 179460

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About