Skip Menu |

This queue is for tickets about the Mail-IMAPClient CPAN distribution.

Report information
The Basics
Id: 107011
Status: resolved
Priority: 0/
Queue: Mail-IMAPClient

People
Owner: PLOBBES [...] cpan.org
Requestors: gilles.lamiral [...] laposte.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 3.38



Subject: folders_hash() attrs documentation mistake.
Date: Thu, 10 Sep 2015 17:24:39 +0200
To: bug-Mail-IMAPClient [...] rt.cpan.org
From: Gilles LAMIRAL <gilles.lamiral [...] laposte.net>
Hi Phil, http://search.cpan.org/dist/Mail-IMAPClient/lib/Mail/IMAPClient.pod#folders_hash The doc says: { name => 'Mail/Box/Name', attrs => '\Marked \HasNoChildren', delim => '/', } but the code returns something like this: { name => 'Mail/Box/Name', attrs => [ '\Marked', '\HasNoChildren' ] delim => '/', } Also the code example given is wrong and show nothing useful, this one: my $sattr_re = /\b\\(?:All|Archive|Drafts|Flagged|Junk|Sent|Trash)\b/; foreach my $fhash (@fhashes) { next unless ( $fhash->{attrs} =~ $sattr_re ); print("special: $fhash->{name} : $fhash->{attrs}\n"); } The following match the code: foreach my $fhash (@fhashes) { my @special = grep ( /\\(?:All|Archive|Drafts|Flagged|Junk|Sent|Trash)/, @{ $fhash->{attrs} } ) ; print("special: $fhash->{name} : @special\n") if ( @special ) ; } Checked on latest 3.37 Mail::IMAPClient. Don't change the code, code is ok, change the doc. Thanks in advance. -- Au revoir, 09 51 84 42 42 Gilles Lamiral. France, Baulon (35580) 06 20 79 76 06
On Thu Sep 10 11:24:59 2015, gilles.lamiral@laposte.net wrote: ... (folders_hash) ... Show quoted text
> but the code returns something like this: > > { > name => 'Mail/Box/Name', > attrs => [ > '\Marked', > '\HasNoChildren' > ] > delim => '/', > } > > Also the code example given is wrong and show nothing useful...
Thanks Gilles! As it turned out, your observations about the docs reminded me that I was misusing attrs in is_parent() too. Here are the changes I've made for a future 3.38 release: https://github.com/plobbes/mail-imapclient/commit/83f68e7062079af503ce3d126198f786d61e98d5
Subject: Re: [rt.cpan.org #107011] folders_hash() attrs documentation mistake.
Date: Wed, 16 Sep 2015 00:20:14 +0200
To: bug-Mail-IMAPClient [...] rt.cpan.org
From: Gilles LAMIRAL <gilles.lamiral [...] laposte.net>
Thanks a lot Phil! Le 15/09/2015 23:03, Phil Pearl (Lobbes) via RT a écrit : Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=107011 > > > On Thu Sep 10 11:24:59 2015, gilles.lamiral@laposte.net wrote: > ... (folders_hash) ... >
>> but the code returns something like this: >> >> { >> name => 'Mail/Box/Name', >> attrs => [ >> '\Marked', >> '\HasNoChildren' >> ] >> delim => '/', >> } >> >> Also the code example given is wrong and show nothing useful...
> > Thanks Gilles! As it turned out, your observations about the docs reminded me that I was misusing attrs in is_parent() too. > > Here are the changes I've made for a future 3.38 release: > https://github.com/plobbes/mail-imapclient/commit/83f68e7062079af503ce3d126198f786d61e98d5 >
-- Au revoir, 09 51 84 42 42 Gilles Lamiral. France, Baulon (35580) 06 20 79 76 06
http://search.cpan.org/~plobbes/Mail-IMAPClient-3.38/ is out and include the fix for this bug.