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


In reply to Re: IO::Prompter not returning from Enter keypress using Activeperl by davido
in thread IO::Prompter not returning from Enter keypress using Activeperl by lewnewby

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.