App::Open::Backend::YAML: A generic YAML hashmap of extensions/schemes to programs.
Please read App::Open::Backend for information on how to use backends.
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.
Read App::Open::Backend for what the interface provides, method descriptions here will only cover implementation.
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 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.
Return the command string from the extension lookup.
Return the command string from the scheme lookup.
This actually just cheats and calls `lookup file` with a colon appended.
Returns the filename where the defintions used are kept.
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.
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.
To install App::Open, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Open
CPAN shell
perl -MCPAN -e shell install App::Open
For more information on module installation, please visit the detailed CPAN module installation guide.