I’m running Strawberry Perl on Windows and I want to print a “Default Value” into the command prompt, so that a user can edit it, then press Enter and Perl will see it as a new STDIN line. I’ve been told to use IO::Prompt, but it has been established that this does not work in Windows.
Short of making a GUI with Tk or something, how can I do this?
ExtUtils::MakeMaker has a
promptfunction, which is very platform independent. I’m not suggesting that it be used in your case, but the POD for IO::Prompt::Tiny states that itspromptfunction is based on the wayExtUtils::MakeMakerdoes it. The smoke tests seem to reflect that IO::Prompt::Tiny has achieved better portability (including Windows). You might give it a try.It’s a little early in the smoke testing of this new module to say for certain, but if it’s based on
ExtUtils::MakeMaker‘sprompt, it’s designed for portability.Term::Prompt is another option. It has been around longer and has a longer history of multi-platform smoke test success. But it has non-core dependencies of
Term::ReadKeyandText::Wrap.IO::Prompt::Tinysticks to core dependencies, if that’s a concern.Output: