NAME

Email::MIME::ContentType - Parse a MIME Content-Type Header

VERSION

version 1.012

$Id$

SYNOPSIS

use Email::MIME::ContentType;
my $ct = "Content-Type: text/plain; charset="us-ascii"; format=flowed";
my $data = parse_content_type($ct);
$data = {
  discrete => "text",
  composite => "plain",
  attributes => {
      charset => "us-ascii",
      format => "flowed"
  }
}

DESCRIPTION

This module is responsible for parsing email content type headers according to section 5.1 of RFC 2045. It returns a hash as above, with entries for the discrete type, the composite type, and a hash of attributes.

WARNINGS

This is not a valid content-type header, according to both RFC 1521 and RFC 2045:

Content-Type: type/subtype;

If a semicolon appears, a parameter must. parse_content_type will carp if it encounters a header of this type, but you can suppress this by setting $Email::MIME::ContentType::STRICT_PARAMS to a false value. Please consider localizing this assignment!

EXPORT

parse_content_type

AUTHOR

Casey West, casey@geeknest.com Simon Cozens, simon@cpan.org

CONTACT

Perl Email Project, pep@perl.org.

SEE ALSO

Email::MIME