Email::Simple::Header - the header of an Email::Simple message
my $email = Email::Simple->new($text); my $header = $email->header_obj; print $header->as_string;
This method implements the headers of an Email::Simple object. It is a very minimal interface, and is mostly for private consumption at the moment.
my $header = Email::Simple::Header->new($head, \%arg);
$head is a string containing a valid email header, or a reference to such a string. If a reference is passed in, don't expect that it won't be altered.
Valid arguments are:
crlf - the header's newline; defaults to CRLF
my $string = $header->as_string(\%arg);
This returns a stringified version of the header.
This method returns a list of the unique header names found in this header, in no particular order.
my @pairs = $header->header_pairs; my $first_name = $pairs; my $first_value = $pairs;
This method returns a list of all the field/value pairs in the header, in the order that they appear in the header. (Remember: don't try assigning that to a hash. Some fields may appear more than once!)
my $first_value = $header->header($field); my @all_values = $header->header($field);
This method returns the value or values of the given header field. If the named field does not appear in the header, this method returns false.
$header->header_set($field => @values);
This method updates the value of the given header. Existing headers have their values set in place. Additional headers are added at the end. If no values are given to set, the header will be removed from to the message entirely.
This method returns the newline string used in the header.
This software is copyright (c) 2003 by Simon Cozens.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.