time-out coding in perl

looking for ideas and not answers! to coding a timeout solution in Perl to answer a user prompt.

ie, when the program asks whether to execute Y/N and no response is entered, after a time period (maybe 10 seconds) the program will automatically choose yes (or maybe no, whicheva).

this isn't homework, i just don't have any examples of similar code and I need some inspiration!

thanx in anticipation!!!

Since suggestions were asked for - here is one from Perl's FAQ