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 .)