http://www.perlmonks.org?node_id=745333


in reply to Keep the playback rolling (Win32)

In doing something similar I found that you don't have to visibily move the mouse pointer to keep the screensaver at bay (although you obviously lose your cool diamond effect!)
use Win32::GuiTest qw(SendMouseMoveRel); while (1) { SendMouseMoveRel(0,0); sleep 1; }