List::Filter::Storage::YAML - plugin for filter storage via YAML files
# This is a plugin, not intended for direct use.
# See: List:Filter:Storage
use List::Filter::Storage::YAML;
my $storage = List::Filter::Storage::YAML->new( {
connect_to => $yaml_file,
} );
my $filter = List::Filter->new(
{ name => 'some_search_filter',
# [... see List::Filter ...]
} );
$storage->save( $filter )
my $named_filter = $storage->lookup( $name );
List::Filter::Storage::YAML is the plugin
that handles storage of List::Filter "filters"
(e.g. "filters", "transforms") to YAML files.
Instantiates a new List::Filter::Profile object.
Takes an optional hashref as an argument, with named fields
identical to the names of the object attributes.
With no arguments, the newly created filter will be empty.
Initialize object attributes and then lock them down to prevent
accidental creation of new ones.
Note: there is no leading underscore on name "init", though it's
arguably an "internal" routine (i.e. not likely to be of use to
client code).
Outside of this module, a "filter" is an object, inside of this
module, it's a hashref with four fields: "method", "description",
"terms", "modifiers". Note, that the "name" is excluded
from this list, because each of these hashrefs is stored inside
a larger hashref, keyed by "name" for rapid lookups.
The external YAML file contains a copy of this data structure,
and it is read and written in it's entirety, and held cached in
memory inside this object.
Joseph Brenner, <doom@kzsu.stanford.edu>,
18 May 2007
Copyright (C) 2007 by Joseph Brenner
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.2 or,
at your option, any later version of Perl 5 you may have available.