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