.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Email::Simple::Header 3pm" .TH Email::Simple::Header 3pm "2018-06-22" "perl v5.26.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Email::Simple::Header \- the header of an Email::Simple message .SH "VERSION" .IX Header "VERSION" version 2.216 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& my $email = Email::Simple\->new($text); \& \& my $header = $email\->header_obj; \& print $header\->as_string; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" 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. .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" .Vb 1 \& my $header = Email::Simple::Header\->new($head, \e%arg); .Ve .PP \&\f(CW$head\fR 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. .PP Valid arguments are: .PP .Vb 1 \& crlf \- the header\*(Aqs newline; defaults to CRLF .Ve .SS "as_string" .IX Subsection "as_string" .Vb 1 \& my $string = $header\->as_string(\e%arg); .Ve .PP This returns a stringified version of the header. .SS "header_names" .IX Subsection "header_names" This method returns a list of the unique header names found in this header, in no particular order. .SS "header_raw_pairs" .IX Subsection "header_raw_pairs" .Vb 3 \& my @pairs = $header\->header_raw_pairs; \& my $first_name = $pairs[0]; \& my $first_value = $pairs[1]; .Ve .PP 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!) .SS "header_pairs" .IX Subsection "header_pairs" header_pairs is another name for header_raw_pairs, which was the original name for the method and which you'll see most often. In general, though, it's better to be explicit and use header_raw_pairs. (In Email::MIME, header_str_pairs exists for letting the library do the header decoding for you.) .SS "header_raw" .IX Subsection "header_raw" .Vb 3 \& my $first_value = $header\->header_raw($field); \& my $nth_value = $header\->header_raw($field, $index); \& my @all_values = $header\->header_raw($field); .Ve .PP 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. .SS "header" .IX Subsection "header" This method just calls \f(CW\*(C`header_raw\*(C'\fR. It's the older name for \f(CW\*(C`header_raw\*(C'\fR, but it can be a problem because Email::MIME, a subclass of Email::Simple, makes \f(CW\*(C`header\*(C'\fR return the header's decoded value. .SS "header_raw_set" .IX Subsection "header_raw_set" .Vb 1 \& $header\->header_raw_set($field => @values); .Ve .PP 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. .SS "header_set" .IX Subsection "header_set" header_set is another name for header_raw_set, which was the original name for the method and which you'll see most often. In general, though, it's better to be explicit and use header_raw_set. (In Email::MIME, header_str_set exists for letting the library do the header encoding for you.) .SS "header_raw_prepend" .IX Subsection "header_raw_prepend" .Vb 1 \& $header\->header_raw_prepend($field => $value); .Ve .PP This method adds a new instance of the name field as the first field in the header. .SS "crlf" .IX Subsection "crlf" This method returns the newline string used in the header. .SH "AUTHORS" .IX Header "AUTHORS" .IP "\(bu" 4 Simon Cozens .IP "\(bu" 4 Casey West .IP "\(bu" 4 Ricardo \s-1SIGNES\s0 .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2003 by Simon Cozens. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.