Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: sar [...] mitre.org
Cc:
AdminCc:

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



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
(sorry, your message got coverred in spam) I do not think that the change is needed. When you pass a GLOB, it is always by reference, and does not need to be de-reffed. Compare perl -we 'sub x { $y= shift; print $y "text\n" }; x \*STDOUT'
No follow-up so closed