in reply to We interrupt this program...

You could use Term::ReadKey to check if a key was pressed without blocking.