VMS::Time module
Thomas Pfau <[email protected]> Mon, 24 Dec 2012 17:19:11 -0500
| Newsgroups | gmane.comp.lang.perl.ports.vms |
|---|---|
| Message-ID | <CAMmy4eVtzq87ja-_ROcF6U1APtEDSWnb+dcNSc10vrfRpMgauA@mail.gmail.com> |
I wrote a time module that interfaces to the VMS time system services -
$BINTIM, $ASCTIM, $GETTIM, and $NUMTIM. I also had a replacement routines
for $ASCTIM, $BINTIM and $GETTIM that could be used on non-VMS platforms.
Currently it accepts and returns VMS time buffers as 8 byte strings but I
was thinking of allowing numeric values to be passed if perl was built with
64 bit integer support. I could detect the input format by using
SvIOK/SvPOK. The problem I have is determining how the user wants the
information returned.
Current interface ($now and $bin are 8 byte strings containing the time):
$now = gettim();
$bin = bintim('01-jan-2010 12:00:00.00');
$asc = asctim($bin);
($year, $month, $day, $hr, $mn, $sc, $cc) = numtim($bin);
I'm thinking of using an optional additional argument on gettim and bintim
that would be written with the 8 byte string and have the routines return
the time as an integer if perl is built with 64 bit integers. I could try
to interface to the bigint module and return a bigint value if 64 bit
integers aren't available.
Would anyone find this useful? Any comments on the interface?
--
Thomas Pfau
[email protected]
http://www.linkedin.com/in/thomaspfau
http://nbpfaus.net/~pfau/