Skip Menu |

This queue is for tickets about the Mail-IMAPClient CPAN distribution.

Report information
The Basics
Id: 57048
Status: resolved
Priority: 0/
Queue: Mail-IMAPClient

People
Owner: PLOBBES [...] cpan.org
Requestors: dmitry.ovechkin [...] gmail.com
matthaeuskiem [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 3.17
Fixed in: 3.24



Subject: little bug
Date: Thu, 29 Apr 2010 20:04:37 +0200
To: bug-Mail-IMAPClient [...] rt.cpan.org
From: Matthäus Kiem <matthaeuskiem [...] gmail.com>
Hello, there might be a little bug in IMAPClient.pm. Please follow the link http://stackoverflow.com/questions/2736265/where-does-come-from-in-this-perl- foreach-loop sub _quote_search { my ( $self, @args ) = @_; my @ret; foreach my $v (@args) { if ( ref($v) eq "SCALAR" ) { push( @ret, $$v ); } elsif ( exists $SEARCH_KEYS{ uc($_) } ) { # <----------- the $_ push( @ret, $v ); } elsif ( @args == 1 ) { push( @ret, $v ); # <3.17 compat: caller responsible for quoting } else { push( @ret, $self->Quote($v) ); } } return @ret; }
Definitely a bug, thanks for the report! This will be fixed in the next release.
Version 3.24 is out with a patch for this bug and others. Thanks for your report. Please feel free to submit a new bug if you find problems with 3.24! PS. I updated the 'subject' to be more descriptive of the bug.
Subject: Use of uninitialized value $_ in uc at /usr/lib/perl5/vendor_perl/5.12.2/Mail/IMAPClient.pm line 2630.
Date: Sat, 27 Nov 2010 19:12:18 +0300
To: bug-Mail-IMAPClient [...] rt.cpan.org
From: Dmitry Ovechkin <dmitry.ovechkin [...] gmail.com>
Hello, thanks a lot for your great work! After upgrading to pel 5.12.2 and Mail-IMAPClient-3.23 on Gentoo Linux I started to get warning === Use of uninitialized value $_ in uc at /usr/lib/perl5/vendor_perl/5.12.2/Mail/IMAPClient.pm line 2630 === during $imap->search("UNSEEN")/$imap->search("ALL") (didn't try anything else) on both gmail.com and newmail.ru accounts. Code is straitforward: ... $imap = Mail::IMAPClient->new( ... ); $imap->select("INBOX"); @msg = $imap->search("ALL"); ... I quick-fixed it with additional check, but I'n not sure if it's corrent solution or not. --- IMAPClient.pm 2010-11-27 17:42:52.589735999 +0300 +++ /usr/lib/perl5/vendor_perl/5.12.2/Mail/IMAPClient.pm 2010-11-27 17:44:36.456735996 +0300 @@ -2627,7 +2627,7 @@ sub _quote_search { if ( ref($v) eq "SCALAR" ) { push( @ret, $$v ); } - elsif ( exists $SEARCH_KEYS{ uc($_) } ) { + elsif ( defined( $_ ) && exists $SEARCH_KEYS{ uc($_) } ) { push( @ret, $v ); } elsif ( @args == 1 ) { Best regards, Dmitry.
This was fixed in 3.24, here's the relevant change log entry: - rt.cpan.org#57048: _quote_search() using $_ in loop instead of $v [Matthaus Kiem]