SYNOPSIS

 my $mc = new Mail::Cap;
 $desc = $mc->description('image/gif');

 print "GIF desc: $desc\n";
 $cmd = $mc->viewCmd('text/plain; charset=iso-8859-1', 'file.txt');

DESCRIPTION

Parse mailcap files as specified in "RFC 1524 --A User Agent Configuration Mechanism For Multimedia Mail Format Information>. In the description below $type refers to the MIME type as specified in the Content-Type header of mail or HTTP messages. Examples of types are:

  image/gif
  text/html
  text/plain; charset=iso-8859-1

You could also take a look at the File::MimeInfo distribution, which are accessing tables which are used by many applications on a system, and therefore have succeeded the mail-cap specifications on modern (UNIX) systems.