NAME

App::Open::Backend::YAML: A generic YAML hashmap of extensions/schemes to programs.

SYNOPSIS

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

CONFIGURING

The YAML backend uses a specific key/value format to correlate extensions and schemes to programs used to launch them.

The file format is fairly simple:

 ----
 "gz": gunzip
 "http:": firefox -newtab %s
 "tar.gz": tar vxzf %s

There are two types of keys: extensions and schemes. Extensions are your standard file extensions, and omit any leading punctuation. Schemes are the protocol scheme in a URL (e.g., http) and are postfixed with a colon (`:'). A scheme without this colon will be treated like an extension and thusly ignored for URLs, and obviously the inverse is true for extensions.

Extensions can be compound and have a defined processing order. See App::Open::Backend or App::Open::Using for more information.

The default filename for these references is $HOME/.mimeyaml, but this is trivial to redefine by providing an argument to the backend configuration. See the aforementioned documentation for more information.

METHODS

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

new

The only argument provided here is the name of the YAML definition file, which defaults to $HOME/.mimeyaml if nothing is provided.

The filename is stowed and load_definitions() is called. BACKEND_CONFIG_ERROR is thrown if the constructor argument is not an array containing strings.

load_definitions

Load the definitions from the YAML file. BACKEND_CONFIG_ERROR is thrown if syntax checking fails, the result is an abnormal data structure (not a flat hash), or the loading resulted in undef.

With any luck, a correct data structure will get stowed in the `defs` member and processing will continue.

lookup_file($extension)

Return the command string from the extension lookup.

lookup_url($scheme)

Return the command string from the scheme lookup.

This actually just cheats and calls `lookup file` with a colon appended.

def_file

Returns the filename where the defintions used are kept.

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.