How can we test if a system that handles sessions will properly handle timeout? Let's say after successful login, the system needs to let us use it for 60 seconds, but after 60 seconds it has to time out and prompt us for password. If we want to make sure it really prompts us for password we have to wait 60 seconds every time we run our tests. What if the requirement is to time out after 1 year?
Clearly we cannot let out test script to wait for that. Even 60 secons is too much.
Instead of that we can ask perl to lie about the time. In other words, we can mock time.