Previously it just waited for the user to type the right thing without
prompting that it was doing so.
It also prints a BEL character to notify that attention is needed.
(cherry picked from commit
4b79a8599508f7ad03e4f6e8b62062f5ba989969)
Signed-off-by: Nicolas R <atoomic@cpan.org>
my $q = shift;
my $a;
local $| = 1;
- print "\n$q [y/n] ";
- do { $a = <>; } while ($a !~ /^\s*([yn])\s*$/i);
+ do {
+ print "\a\n$q [y/n] ";
+ $a = <>; }
+ while ($a !~ /^\s*([yn])\s*$/i);
return lc $1 eq 'y';
}