(a) Your subject line doesn't seem to have anything to do with the question in your message.
(b) The documentation for Mail::IMAPClient says that the search() method arguments are appended to an IMAP SEARCH command. I think if you look at the relevent section of the IMAP RFC (https://tools.ietf.org/html/rfc3501#section-6.4.4) you'll find some examples similar to what you're doing. You probably also want to heed the note in the Mail::IMAPClient documentation about how to distinguish a legit search that returns zero hits versus a search that fails. chrs, john. On Mon, Jul 29, 2013 at 1:56 PM, Chris Datfung <chris.datf...@gmail.com> wrote: > > I get a daily email attachment to my Gmail account which I want to > automatically download. I found the following Perl script which does just > that: > > http://stackoverflow.com/questions/2453548/how-can-i-download-imap-mail-attachments-over-ssl-and-save-them-locally-using-pe > > The above script uses the following syntax to search the messages via IMAP: > > my @messages = $imap->search(SUBJECT => $today); > > In my case, I want to search on two criteria, subject and date. I tried > various ways such as: > > my @messages = $imap->search(SUBJECT => $subject, ON => $today); > > my @messages = $imap->search({SUBJECT => $subject, ON => $today}); > > my @messages = $imap->search("SUBJECT => $subject, ON => $today"); > > but none of these worked. How can I search on multiple criteria using > Mail::IMAPClient? > > Thanks, > Chris -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/