I'd be inclined to use IO::Select to get notification that STDIN has some data for you. It's pretty simple to use, you can wait in a loop for a timeout of 1s for input, and update the clock if you don't get it.
As the other reply says, there's got to be a more legible way of moving the cursor around :-)