Like some of the other posters here, I'm inclined to think that setting a screen saver might be better. Either way, Term::ReadKey will almost certainly not do the job, because it catches keypresses for a terminal window, not for the whole system.
That said, you might want to check out MSDN and see if there are any functions that will let you determine if the computer is idle. Then use the Win32::API module to call that function and determine when the screen is ready to be locked. Then you can probably call a different function to do the actual locking.
The computer can't tell you the emotional story. It can give you the exact mathematical design, but what's missing is the eyebrows.
- Frank Zappa