Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Simulating the Future

by dynamo (Chaplain)
on Jan 04, 2008 at 19:53 UTC ( [id://660461] : note . print w/replies, xml ) Need Help??


in reply to Re: Simulating the Future
in thread Simulating the Future

Well, that's sorta like what I was thinking.. The problem is that I can't make something like mytime() and replace throughout the code because A> waaaay too many to replace, and B> it's an internal codebase change. The testing system has to fake the time externally to validate the code, otherwise it would be modified again when I take out the test..

My first thought was to try using something like this:

package FakeTime; sub main::time { 12345 } 1;
That didn't work. Neither did "sub ::time { 12345 }", I thought that might work as a second resort. Didn't.

- d