folder->messages(begin, end) implementation on maildir

"Mike J. Vincelette" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.mail-box
Message-ID <[email protected]>
I'm getting some strange behavior using the "folder->messages(begin, 
end) construction. I can work around it, but I think it may be a bug.

Let's say I have exactly ONE mail message in a maildir folder ($folder). 
(The message is in the "new" maildir subfolder, and nothing is in the 
tmp or cur subfolders). The following code:

    my $n = $folder->messages;
    print "cnt=$n\n";
    $n = $folder->messages('ALL');
    print "cnt=$n\n"
    $n = $folder->messages(0, 20);
    print "cnt=$n\n"

Produces:

    cnt=1
    cnt=1
    Use of uninitialized value in concatenation (.) or string at 
./testprocess.pl line 54.
    cnt=

Line #54 is the last "print" line (print "cnt=$n\n").

Similarly, if I use @emails = $folder->messages(0, 10), I get an array 
of size=2. If I loop through the messages using foreach, the loop will 
process twice and the $message object in the second iteration is undefined.

If I use $folder->messages('ALL') or any other construction, this works 
fine.

Mike
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.