Sorry I wasn't clear. $^T is along the lines of what I'm
looking for, but I also already thought of this. What I
want is to make all time calls transparently return
times relative to some known starting point rather than the
current time; i.e., make it look like the script is running
in the past or future. If $^T were also used as some
sort of relative base time, that seems like it could work.
But it's not used that way so time() and other calls
return the true time.
I'd have two uses for something like this:
- Testing date/time interfaces;
- Forcing certain scripts to run "back in time" for the
purposes of creating specific time stamped files, or
whatever.
I understand the dangers and tradeoffs of doing this. I
just wanted to know if it was possible. Setting a
local
$^T value is along the lines of what I was
looking for, only with more widespread effect.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.