This sounds like a homework question (a question requiring a couple of concepts without an obvious real-world application). Don't be afraid to state that it is.
That being said, if I were to implement this, I would want a few items:
- A counter to store the remaining time (perhaps a global variable or a lexical variable or a
Time::DurationTime::Interval or some other Interval object or some such; perlsyn for some background reading)
- A method to decrease the counter (see perlop and search for decrement)
- A method to display the counter in the correct format. (see printf as one option)
- A method to determine if I am at a 10 second mark (see perlop and search for modulo)
- A method to prompt a user for input (printf or Prompt might be useful)
- A method to compare strings (see perlop for the difference between eq/ne and ==/!= or perlretut for regular expression help)
- A method to break out of a loop (see perlsyn for last and next)
Show your work, be honest about the homework status, ask questions. Just like coursework, you tend to get more out of PerlMonks if you put more of yourself into it.