SYNOPSIS

 use MIME::Types;
 my $mimetypes = MIME::Types->new;
 my MIME::Type $def = $mimetypes->type('text/plain');
 my MIME::Type $def = $mimetypes->mimeTypeOf('gif');

DESCRIPTION

MIME types are used in MIME compliant lines, for instance as part of e-mail and HTTP traffic, to indicate the type of content which is transmitted. Sometimes real knowledge about a mime-type is need.

This module maintains a set of MIME::Type objects, which each describe one known mime type. There are many types defined by RFCs and vendors, so the list is long but not complete. Please don't hestitate to ask to add additional information.

If you wish to get access to the mime.types files, which are available on various places in UNIX and Linux systems, then have a look at File::TypeInfo.

MIME::Types and mod_perl

This module uses a DATA handle to read all the types at first instantiation. That doesn't work well with the module abuse by mod_perl, which reuses compiled Perl instances by simply clearing the variables.

When you use this module with mod_perl, add this to startup.pl

   use MIME::Types;
   BEGIN { MIME::Types->new() }

Now, the type definitions will get parsed before the processes are spawned.