NAME

App::Open::Backend::MailCap: A backend for using the mailcap system to lookup programs.

SYNOPSIS

Please read App::Open::Backend for information on how to use backends.

METHODS

Read App::Open::Backend for what the interface provides, method descriptions here will only cover implementation.

new

Takes two args, the filename and a "take" argument that corresponds to the Mail::Cap constructor argument of the same name, specifying to take the first mailcap file it finds, or all of them. There is some decision made when either of these arguments is undef, see load_definitions() for more information.

mailcap_file

Return the mailcap filename supplied to the constructor.

mailcap_take

Return the 'take' argument supplied to the constructor.

mailcap

Return the Mail::Cap object.

mime

Return the Mime::Types object.

load_definitions

Load the mailcap definitions and construct Mail::Cap and Mime::Types objects. This method is called from the constructor; there is no reason to call it directly.

This method will generate defaults for the `take` argument depending on what is supplied to the constructor. Basically, if you omit both arguments it will swallow all mailcap files, if you provide a take argument it will use that. If you provide a filename it will just use that, and if you supply `ALL` as the take method and a filename, it will search that file first, then cascade to the rest of the files on the system.

It could be better.

lookup_file($extension)

Given an extension, it will locate the MIME type for that extension via the MIME::Types database, and locate the `view` mailcap entry for it, sanitizing it for templating later.

lookup_url

Always returns undef. AFAICT mailcap does not support URLs.

LICENSE

This file and all portions of the original package are (C) 2008 Erik Hollensbe. Please see the file COPYING in the package for more information.

BUGS AND PATCHES

Probably a lot of them. Report them to <erik@hollensbe.org> if you're feeling kind. Report them to CPAN RT if you'd prefer they never get seen.