Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: aw [...] ice-sa.com
Cc:
AdminCc:

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



Subject: expunge() logic problem
Date: Mon, 21 Apr 2008 15:08:54 +0200
To: bug-Mail-IMAPClient [...] rt.cpan.org
From: André Warnier <aw [...] ice-sa.com>
Hi. In Mail::IMAPClient v 3.06, there seems to be a problem in the expunge() routine, reproduced below. sub expunge { my ($self, $folder) = @_; my $old = $self->Folder || ''; if(defined $old && ($folder eq $old)) { $self->_imap_command('EXPUNGE') or return undef; } else { $self->select($folder); my $succ = $self->_imap_command('EXPUNGE'); $self->select($old); $succ or return undef; } wantarray ? $self->History : $self->Results; } The problem shows when calling this function like : $imap_object->expunge(); (without folder paraneter) Basically it outputs a warning like : Use of uninitialized value in string eq at C:/Perl/site/lib/Mail/IMAPClient.pm line 1762. and it does not do the expunge() of the folder. I made the warning disappear in my case, and the expunge() happen, by prefixing the test as follows : $folder = '' unless defined $folder; if(defined $old && ($folder eq $old)) but I presume the correct solution is somewhat more delicate. Thanks for Mail::IMAPClient anyway, works great. Regards, André W.
Subject: Re: [rt.cpan.org #35260] expunge() logic problem
Date: Mon, 21 Apr 2008 16:14:47 +0200
To: André Warnier via RT <bug-Mail-IMAPClient [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* André Warnier via RT (bug-Mail-IMAPClient@rt.cpan.org) [080421 13:09]: Show quoted text
> my $old = $self->Folder || ''; > if(defined $old && ($folder eq $old))
... Show quoted text
> $folder = '' unless defined $folder; > if(defined $old && ($folder eq $old))
This should have been: my $old = $self->Folder || ''; if(defined $folder && $folder eq $old) ^^^^^^ Thanks for the report. The bug was introduced in the last release. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Just released 3.07 with a fix for your problem