in reply to CLI Interactivity - Timed Prompt
Could easily be altered to use ReadKey(1) and print the prompt every second.print "X done. Y starting in 15 seconds. Press any key to do Z instead +.\n"; my $selection=ReadKey(15); if ($selection) { # Key pressed. Do Z. } else { # No key pressed. Do Y. }
|
|---|