SYNOPSIS

 use Mail::Header;
    
 my $head = Mail::Header->new;
 my $head = Mail::Header->new( \*STDIN );
 my $head = Mail::Header->new( [<>], Modify => 0);

DESCRIPTION

Read, write, create, and manipulate MIME headers, the leading part of each modern e-mail message, but also used in other protocols like HTTP. The fields are kept in Mail::Field objects.

Be aware that the header fields each have a name part, which shall be treated case-insensitive, and a content part, which may be folded over multiple lines.

Mail::Header does not always follow the RFCs strict enough, does not help you with character encodings. It does not use weak references where it could (because those did not exist when the module was written) which costs some performance and make the implementation a little more complicated. The Mail::Message::Head implementation is much newer and therefore better.