Skip Menu |

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

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

People
Owner: PLOBBES [...] cpan.org
Requestors: jidanni [...] jidanni.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 3.40
Fixed in: 3.41



Subject: warn instead of die more in certain examples
In unseen Example: my @unread = $imap->unseen or warn "Could not find unseen msgs: $@\n"; The unseen method performs an IMAP SEARCH UNSEEN search against the selected folder and returns an array of sequence numbers of messages that have not yet been seen (ie their \Seen flag is not set). If the "Uid" parameter is true then an array of message UID's will be returned instead. If called in scalar context than a pointer to the array (rather than the array itself) will be returned. Note that when specifying the flag in question, the preceding backslash (\) is entirely optional. We don't get to "specify the flag in question" here, so that final line is misplaced. messages Example: # Get a list of messages in the current folder: my @msgs = $imap->messages or die "Could not messages: $@\n"; # Get a reference to an array of messages in the current folder: my $msgs = $imap->messages or die "Could not messages: $@\n"; If called in list context, the messages method returns a list of all the messages in the currently selected folder. If called in scalar context, it returns a reference to an array containing all the messages in the folder. If you have the "Uid" parameter turned off, then this is the same as specifying "1 ... $imap->message_count"; if you have UID set to true then this is the same as specifying "$imap->"search"("ALL")". Maybe warn instead of dying It should mention what if there are simply no messages, then it will return an empty array. messages Example: # Get a list of messages in the current folder: my @msgs = $imap->messages or die "Could not messages: $@\n"; # Get a reference to an array of messages in the current folder: my $msgs = $imap->messages or die "Could not messages: $@\n"; Maybe warn like above instead of dying would be a better example. (P.S., the two "Could not messages:" is missing a verb, #128215 .)
Made changes in the following commit that will be part of the next release: commit 3284f8849bbe51702f80d5dbae7b1de4cffc9491 Author: Phil Pearl (Lobbes) <plobbes@gmail.com> Date: Wed Jan 16 15:29:51 2019 +0000 - POD cleanup: unseen(), messages() and similar examples
The fix for this issue is in version 3.41 which was released several hours ago.