[langage] Parcourir une list de array
Bonjour,
j'ai le code suivant (en gros) :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
use Cyrus::IMAP::Admin;
my $imap = Cyrus::IMAP::Admin->new('localhost', 143);
$imap->authenticate(
-user => $user,
-mechanism => "LOGIN",
-password => $password,
);
my @list = $imap->list("user.*");
my $nb = @list;
for(my $count=0; $count < $nb;$count++) {
$box = $list[$count][0];
print "$box\n";
} |
Sauf que faire un for avec un $count ne me plait pas trop. J'aurais voulu faire un foreach. Mai pas moyen de trouver comment faire.
Selon la doc :
Code:
1 2 3 4 5 6 7 8
|
listmailbox($pattern[, $reference])
list($pattern[, $reference])
List mailboxes matching the specified pattern, start
ing from the specified reference. The result is a
list; each element is an array containing the mailbox
name, attributes, and the separator. (This interface
may change.) |
Merci.