IO::Prompt::Timeout - Simple prompt interface with timeout.
use IO::Prompt::Timeout qw(:all); my $answer = prompt('Yes or No? (y/n)', %option); my $is_timeout = has_prompt_timed_out(); # Specifying timeout seconds my $answer = prompt('Yes or No? (y/n) Answer in 10 seconds.', timeout => 10); # Specifying default answer my $answer = prompt('Yes or No? (y/n)', default => 'n');
IO::Prompt::Timeout provides prompt subroutine most of which comes from ExtUtils::MakeMaker.
It also has timeout feature just like Prompt::Timeout. The default timeout seconds is 60. When prompt timed out, the default answer can be taken when it's set by option.
Unlike Prompt::Timeout, this module uses IO::Select for timeout procedure. The function of clearing timer by a single key click is not supported which is implemented in Prompt::Timeout.
Show prompt and returns the answer by user's input.
Called after a prompt call. Returns if prompt subroutine has timed out or not.
If set true, prompt will always return the default answer without waiting for user input.
ExtUtils::MakeMaker, IO::Prompt::Tiny, Prompt::Timeout, IO::Select
Copyright (C) YASUTAKE Kiyoshi.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
YASUTAKE Kiyoshi <yasutake.kiyoshi@gmail.com>
To install IO::Prompt::Timeout, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IO::Prompt::Timeout
CPAN shell
perl -MCPAN -e shell install IO::Prompt::Timeout
For more information on module installation, please visit the detailed CPAN module installation guide.