Subject: | bug in sub message_to_file |
Date: | Tue, 6 May 2008 12:00:59 -0400 |
To: | <bug-Mail-IMAPClient [...] rt.cpan.org> |
From: | "Renner, Scott A." <sar [...] mitre.org> |
There's a bug in 3.06. I reported it long ago, but that was when
nobody was maintaining the library.
It's a simple bug. It only appears when you try to call
message_to_file with a reference to a file handle. Apparently I'm the
only guy who ever does this :-)
Here's the existing code:
sub message_to_file
{ my $self = shift;
my $fh = shift;
my $msgs = join ',', @_;
my $handle;
if(ref $fh) { $handle = $fh }
else
And here's the fixed code:
sub message_to_file
{ my $self = shift;
my $fh = shift;
my $msgs = join ',', @_;
my $handle;
if(ref $fh) { $handle = $$fh }
else
The problem is a missing "$" character in the $handle assignment.
Pretty obvious once you look at it.
BTW, I've just tested 3.06 with a program that used the old,
pre-rewrite library, and a whole bunch of input mail. Everything
worked the same as far as I can tell. I mostly exercise
folders
select
search
parse_headers(\@list,'message-id','content-class')
parse_headers($uid,'message-id','content-class')
message_string
message_to_file
flags
size
Hope this helps.
cheers,
-- scott