in reply to IO::Prompter not returning from Enter keypress using Activeperl
Which version of IO::Prompter? I see test failures on at least one Windows system in some of the earlier versions. The most recent version (0.004005) seems to have a more successful smoke test record, but I see from its change log that the most recent version disables interactive testing on Windows platforms, so it's possible a problem is being missed by the tests.
IO::Prompt::Tiny is designed to be highly portable, as it's based on ExtUtils::MakeMaker's prompt, which must be portable. Your simple functionality would be perfectly fine with IO::Prompt::Tiny. IO::Prompt::Hooked is based on IO::Prompt::Tiny, and should be as portable, but might even simplify your logic a little:
use IO::Prompt::Hooked; my $string = prompt ( message => 'Input a string:', validate => sub { q{} ne shift } );
...or even...
my $string = prompt ( message => 'Input a string:', validate => qr/./ );
Do make sure that the environment variable PERL_MM_USE_DEFAULT is not set.
Dave
|
|---|