Skip Menu |

This queue is for tickets about the IO-Prompt CPAN distribution.

Report information
The Basics
Id: 123148
Status: rejected
Priority: 0/
Queue: IO-Prompt

People
Owner: Nobody in particular
Requestors: burak [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: 0.997004



Subject: Use of uninitialized value $response in ord
Hi, A warning is emitted when you just hit enter, which is pretty annoying. [patch attached] $ perlMIO::Prompt -wE 'prompt -menu => [1..4],-default=>"";' a. 1 b. 2 c. 3 d. 4 Show quoted text
> []
Use of uninitialized value $response in ord at /Users/bgursoy/.plenv/versions/5.26.0/lib/perl5/site_perl/5.26.0/IO/Prompt.pm line 589. $ perl -MIO::Prompt -wE 'say for IO::Prompt->VERSION, $^V' 0.997004 v5.26.0
Subject: warning.patch
--- Prompt.pm.orig 2017-09-27 17:51:25.000000000 +0200 +++ lib/IO/Prompt.pm 2017-09-28 12:13:43.000000000 +0200 @@ -586,15 +586,24 @@ } } print {$OUT} "\n"; - my $selection = $data[ord($response)-ord('a')]; - $response = defined $response ? $val_for->($selection) : $response; - if (defined $response && ref($response) =~ m/\A(?:HASH|ARRAY)\z/xms ) { + my $selection; + + if ( defined $response ) { + $selection = $data[ord($response)-ord('a')]; + $response = $val_for->($selection); + } + + if ( defined $response + && defined $selection + && ref($response) =~ m/\A(?:HASH|ARRAY)\z/xms + ) { $response = _menu($IN, $OUT, {%{$flags}, -menu=>$response}, "$selection: "); if (defined $response && $response eq "\e") { print {$OUT} "\n", @prompt if -t $IN; next; } } + return _tidy($response); } }
Subject: Re: [rt.cpan.org #123148] Use of uninitialized value $response in ord
Date: Thu, 28 Sep 2017 21:17:21 +1000
To: bug-IO-Prompt [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Thank-you for taking the time to report this issue, and especially for providing a patch for it. Unfortunately, I am no longer actively maintaining the IO::Prompt module. If you would like to be granted maintenance rights to it, so that you can continue supporting it yourself, please let me know and I will be happy to turn the module over to you. All the best, Damian
28 Eyl 2017 Prş, 07:18:12 tarihinde, damian@conway.org yazdı: Show quoted text
> Thank-you for taking the time to report this issue, and especially for > providing a patch for it. > > Unfortunately, I am no longer actively maintaining > the IO::Prompt module. > > If you would like to be granted maintenance rights > to it, so that you can continue supporting it yourself, > please let me know and I will be happy to turn the > module over to you. > > All the best, > > Damian
Hi, Thanks for your reply, but I;ve failed to notice the deprecation notice in the documentation and switched the code to IO::Prompter instead which seems to be fine. So, I'll just close this ticket instead. Thanks, Burak