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

Time::localtime lvalue accessors

Thread Next
From:
Paul LeoNerd Evans
Date:
August 29, 2012 16:04
Subject:
Time::localtime lvalue accessors
Message ID:
20120829230423.GI19185@cel.leo
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

leonerd@leonerd.org.uk
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About