in reply to Using Mail::IMAPClient
If you want to get the combined results of searches for three different subjects, you can run each search individually and build one big list to loop over. Your code might look like this:
There are much cleaner ways to do this (using map with a list of subjects), but hopefully this makes it clearer what is going on.my @results1 = values %{imap->... 'SUBJECT', 'Subj1' ...}; my @results2 = values %{imap->... 'SUBJECT', 'Subj2' ...}; my @results3 = values %{imap->... 'SUBJECT', 'Subj3' ...}; my @all_results = (@results1, @results2, @results3); for my $h (@all_results){ # Your code manipulating $h as before... }
In general, if you want to know the size of an array, you use the array in scalar context. That is to say:
... which would give you the total number of results your search returned. I'm not sure if this is enough in your case though, as you might need to loop over your results to identify only those dated in the last X minutes. Hope this gets you started!# sets $num_results to size of @all_results array. my $num_results = @all_results;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using Mail::IMAPClient
by jpavleck (Initiate) on Nov 08, 2005 at 22:27 UTC |