Subject: | First prompt and last menu prompt skipped |
Date: | Tue, 18 Aug 2015 22:19:37 +0300 |
To: | bug-IO-Prompter [...] rt.cpan.org |
From: | Daniel Drennan <drennan [...] panix.com> |
I just start working with IO::Prompter, and have run into some strange behavior using just a basic script and examples from the CPAN page.
This is perl 5, version 22, subversion 0 (v5.22.0) built for darwin-thread-multi-2level
our $VERSION = '0.004013';
I'm working on a Mac, Snow Leopard 10.6.8.
At first I was using a much more complex script, and was using IO::Prompter in a loop going over file names. The first prompt never showed up. I moved everything to a bare-bones script with just the examples that are on the CPAN page, and the same issue occurred; the first prompt never appeared, and the final prompt of the menu script never appeared either.
On a whim I replaced the use line with use IO::Prompter -argv; and this error message showed up:
Use of uninitialized value $input in pattern match (m//) at /Volumes/DEV0/lib/perl5/site_perl/5.22/IO/Prompter.pm line 251.
But the first prompt now shows up. The final prompt of the menu still doesn't though....
I don't know if this is because I'm using 5.22? Or something else? Not even sure how to debug what's going on....
Thanks for any help!
Daniel
Script:
#!/Volumes/DEV0/bin/perl
use strict;
use warnings;
use IO::Prompter -argv;
my $passwd
= prompt 'Enter your password', -echo=>'*';
my $selection
= prompt 'Choose wisely...', -menu => {
wealth => [ 'moderate', 'vast', 'incalculable' ],
health => [ 'hale', 'hearty', 'rude' ],
wisdom => [ 'cosmic', 'folk' ],
}, '>';