funkymonky has asked for the wisdom of the Perl Monks concerning the following question:

If I use the select command from Mail::IMAPClient $imap->select($folder) the response from the server looks like

* FLAGS (\Answered \Flagged \Draft \Deleted \Seen) * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen \*)] * 3 EXISTS * 0 RECENT * OK [UIDVALIDITY 1030359672] * OK [UIDNEXT 191] 000E OK [READ-WRITE] Completed

The command returns a hash-reference, but when I look at the content of the hash, it does not contain the information the server returned.The hash keys have values like 'Password','CAPABILITY','Socket',etc

QUESTION: how do I get access to response from the server? I'm interested in the UIDNEXT value.(I know the status method returns this info, but there has to be a way to get it from the select method)

Edit kudra, 2002-09-05 s,\\,/,g (all HTML tags were ending with \tag instead of /tag)

Replies are listed 'Best First'.
Re: select command from Mail::IMAPClient
by blahblahblah (Priest) on Sep 05, 2002 at 14:49 UTC
    I don't know how to get it from select(), or why you don't want to use status(), but I thought I'd point out that there's also a uidnext() method.

    If that's not good for the same reason that status() is no good, you could look at the IMAPClient.pm code and figure out how sub uidnext works, it's only a few lines.

Re: select command from Mail::IMAPClient
by jlongino (Parson) on Sep 05, 2002 at 15:41 UTC
    As blahblahblah pointed out, you can't get the information you want from select(). I think you're looking at a dump of the $imap object which does, by the way, contain a History of the commands issued (including the uidnext value). It is a history however and you would have to be careful which uidnext to extract and then extract it from the Debug style text. I wouldn't recommend that tack. Instead, take blahblahblah's advice and check the return from the uidnext parameter query: my $uidnext = $imap->uidnext($folder);

    --Jim