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

Report information
The Basics
Id:
48515
Status:
open
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
mlj [...] sabreit.co.uk
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
(no value)
Fixed in:
(no value)



Subject: problem with $_ undefined when used in module
Date: Fri, 7 Aug 2009 14:19:52 +0100 (BST)
To: bug-IO-Prompt@rt.cpan.org
From: Martin L Jones <mlj@sabreit.co.uk>
To replicate the fault: ==== #!/usr/bin/perl -w use warnings; use strict; Demo::demo(); package Demo; use IO::Prompt; sub demo { my $password = prompt 'Password: ', -echo => '*'; print $password; } 1; ==== Error message is: Use of uninitialized value in pattern match (m//) at /usr/local/share/perl/5.8.8/IO/Prompt.pm line 91. Password: === Don't entirely understand the cause, but adding the line marked '++' below appears to be a workaround: for (my $i = 0 ; $i < @data ; $i++) { local *_ = \($data[$i]); ++ next if (not defined $_); if (ref eq 'HASH') { Thanks again for a very useful module! Martin.
From: richard.hodgson@gmail.com
Confirming this error too: use IO::Prompt; my $password = prompt("Password: ", -e => "*"); print qq{\n} . $password . qq{\n}; Creates the error: Use of uninitialized value $_ in pattern match (m//) at C:/Perl/site/lib/IO/Prompt.pm line 91. Don't really want to alter the source, seeing as I'm testing this for possible use in a system where the user will not be expected to patch their perl modules. On Fri Aug 07 09:20:35 2009, mlj@sabreit.co.uk wrote:
Show quoted text
> > To replicate the fault: > > ==== > #!/usr/bin/perl -w > use warnings; > use strict; > > Demo::demo(); > > package Demo; > use IO::Prompt; > > sub demo { > my $password = prompt 'Password: ', -echo => '*'; > print $password; > } > > 1; > ==== > > Error message is: > > Use of uninitialized value in pattern match (m//) at > /usr/local/share/perl/5.8.8/IO/Prompt.pm line 91. > Password: > > === > > Don't entirely understand the cause, but adding the line marked '++' > below appears to be a workaround: > > > for (my $i = 0 ; $i < @data ; $i++) { > local *_ = \($data[$i]); > ++ next if (not defined $_); > if (ref eq 'HASH') { > > > Thanks again for a very useful module! > > Martin. >
Subject: Re: [rt.cpan.org #48515] problem with $_ undefined when used in module
Date: Wed, 19 Aug 2009 15:49:09 +0200
To: bug-IO-Prompt@rt.cpan.org
From: Damian Conway <damian@conway.org>
Show quoted text
> Confirming this error too: > > use IO::Prompt; > my $password = prompt("Password: ", -e => "*"); > print qq{\n} . $password . qq{\n}; > > Creates the error: > Use of uninitialized value $_ in pattern match (m//) at > C:/Perl/site/lib/IO/Prompt.pm line 91.
Fixed for the next release. If you're interested, try this beta of that release to ensure I've correctly repaired the problem. Thanks, Damian

Message body is not shown because sender requested not to inline it.

On Wed Aug 19 09:49:49 2009, damian@conway.org wrote:
Show quoted text
> > Confirming this error too: > > > > use IO::Prompt; > > my $password = prompt("Password: ", -e => "*"); > > print qq{\n} . $password . qq{\n}; > > > > Creates the error: > > Use of uninitialized value $_ in pattern match (m//) at > > C:/Perl/site/lib/IO/Prompt.pm line 91.
> > Fixed for the next release. If you're interested, try this beta of > that release > to ensure I've correctly repaired the problem. > > Thanks, > > Damian
Hi, the attached file differs from the current version on CPAN (0.996) only by some versioning information. It does not fix this bug, although the patch posted in #48515 does fix the problem for v0.996. Leo
Subject: Re: [rt.cpan.org #48515] problem with $_ undefined when used in module
Date: Wed, 20 Jan 2010 15:07:08 +1100
To: bug-IO-Prompt@rt.cpan.org
From: Damian Conway <damian@conway.org>
Leo,
Show quoted text
> Hi, the attached file differs from the current version on CPAN (0.996) > only by some versioning information. It does not fix this bug, although > the patch posted in #48515 does fix the problem for v0.996.
Okay. Something weird is going on. You're correct that the beta version I sent previously is now the version on CPAN. I updated it 10 days ago. Are you sure you're not still testing with version 0.99.4? Version 0.996 definitely fixes the bug and does not issue the 'undefined' warning...at least, not on my system. Damian


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.