On Mon, 8 Jun 2004, Gisle Aas wrote:

> I don't really like it.  I would have expected a method like
> $res->is_multipart to actually test for $res->content_type =~
> m,^multipart/,.

I had thought that a Content-Type of multipart/ wasn't a requirement in the earlier 
versions of MIME.  I just went through RFC 1341 and indeed you are correct.

> Seems like I should have made 'parts' return the number of parts in
> scalar context instead of the first one.  That would be more useful
> here.  To stay compatible it seems like the best route is to add a
> method called 'num_parts', but it is not clear to me why you want to
> handle multipart messages with one part but not those with more.  If
> the need for testing the number of parts is not a common use case I
> think it is better to leave this method out.

I had some discussion about this on freenode/#perl before submitting the patch.  
Everyone asked why the parts count wasn't returned in scalar context. :)  I had wanted 
to maintain backwards compatibility but, now that I think about it, I doubt many are 
using that method in scalar context.  Why don't you just fix the behavior now?

I don't actually want to handle multi-part messages with just one part, the "<= 1" was 
a left over from some testing.

Cheers,

-J

--

Reply via email to