Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Email-Simple CPAN distribution.

Report information
The Basics
Id: 20684
Status: resolved
Priority: 0/
Queue: Email-Simple

People
Owner: Nobody in particular
Requestors: bricas [...] cpan.org
Cc:
AdminCc:

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



Subject: ordered key/val pairs method
As we discussed on IRC, by calling $obj->header( $name ) you get all values of that header. However, it's not easy to grab all of the header key/value pair back in the order sent in the original message. Perhaps there should be a method that returns every key => pair in order?
Subject: Re: [rt.cpan.org #20684] ordered key/val pairs method
Date: Tue, 25 Jul 2006 13:05:53 -0700
To: bug-Email-Simple [...] rt.cpan.org
From: Casey West <casey [...] geeknest.com>
On Jul 25, 2006, at 11:45 AM, via RT wrote: Show quoted text
> Perhaps there should be a method that returns every key => pair in > order?
How close does the mixin from Email::Simple::Headers get you?
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #20684] ordered key/val pairs method
Date: Tue, 25 Jul 2006 17:25:48 -0400
To: Casey West via RT <bug-Email-Simple [...] rt.cpan.org>
From: Ricardo SIGNES <rjbs [...] cpan.org>
* Casey West via RT <bug-Email-Simple@rt.cpan.org> [2006-07-25T16:06:49] Show quoted text
> On Jul 25, 2006, at 11:45 AM, via RT wrote:
> > Perhaps there should be a method that returns every key => pair in > > order?
> > How close does the mixin from Email::Simple::Headers get you?
It won't help much. It returns shuffle(uniq(headernames)), basically. A simple solution will almost certainly involve adding an extra, optional arg to header(), or a new header-like method, so one can write: $email->header('Received', 3); to get the third (4th?) received header. Then, a routine that returns @{$self->{order}} and a routine that returns each header pair in order is simple. In fact, the latest Subversion version of Email::Simple effectively implements this within _headers_as_string, which now properly respects RFC2822's request to not reorder headers during transport or reproduction. -- rjbs
::Headers has been deprecated, and ->headers, ->header_names, ->header_pairs have been added here. -- rjbs