I'm working on a perl program that's an interactive-front end for launching a lot of long, slow processes I have to do. When one finishes, I would like the program to ask if I would like to continue. That isn't too hard.. but if I don't answer in X amount of time, I want it to stop waiting and to continue on its own. How do I do this?
I'm imagining something like:
X done. Y starting in 15 seconds. Press any key to do Z instead.
X done. Y starting in 14 seconds. Press any key to do Z instead.
...snip...
X done. Y starting in 1 second. Press any key to do Z instead.
No input received, doing Y.
... etc. I'm totally stumped as I have no idea how to do this with <STDIN>. How do I do this?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.