List::Filter::Storage

List::Filter::Storage is a storage handler for filters (e.g. filters).
Download

List::Filter::Storage Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Joseph Brenner
  • Publisher web site:
  • http://search.cpan.org/~doom/

List::Filter::Storage Tags


List::Filter::Storage Description

List::Filter::Storage is a storage handler for filters (e.g. filters). List::Filter::Storage is a storage handler for filters (e.g. filters).SYNOPSIS use List::Filter::Storage; $stash_file = "$ENV{HOME}/project_filters.yaml"; my $filter_storage = List::Filter::Storage->new({ storage => , }); my $filter = List::Filter->new( { name => 'skip_boring_stuff', terms => , method => 'skip_boring_stuff', description => "Skip the really boring stuff", modifiers => "xi", } ); $filter_storage->save( $filter ); # And later, in some other code... my $filter_storage = List::Filter::Storage->new({ storage => }); my $filter = $filter_storage->lookup( 'skip_boring_stuff' ); # Filters lookd up from a path of storage locations: # (1) yaml file (2) a DBI database connection my $yaml_file = "/tmp/filter_storage.yaml"; my $lfs = List::Filter::Storage->new( { storage=> } ); # storage format "MEM" keeps data in memory only my $lfs = List::Filter::Storage->new( { storage=> }); # automatically make copies in the yaml file of any filters used from DBI my $filter_storage = List::Filter::Storage->new( { save_filters_when_used => $args->{ save_filters_when_used }, storage => , } ); # a storage handler can save objects of type 'transform' # (a child of filter): my $storage_tran = List::Filter::Storage->new( { storage => , type => 'transform', } ); $storage_tran->save( $transform );List::Filter::Storage is a "storage handler", it deals with multiple locations of different types of pluggable backing stores to save and retrieve "filters" (and variant types of filters such as 'transforms'). See List::Filter and List::Filter::Transform.To review the nature of the items that need to be stored: At the heart of a "filter" is an array reference called 'terms' which contains a list of arbitrary perl data structures. In the case of the simple 'filter" type, this is a list of regular expressions, in the case of 'transform' it's a list of array references, each containing the three parts of a perl substitution (in an unusual order, counting from 1 to 3: s/1/3/2).Also, in addition to this list of 'terms', each filter object also has some attached to it some additional fields of data: 'name', 'method', 'modifiers', and 'description'.So this might be thought of an ORM system, except that it's much more specialized (or perhaps "even more braindead") than ORMs usually are. Also, while it can use a database as a backing store (via DBI), the default storage system is simply to dump the data to YAML files, which have the advantage of being relatively easy to read and edit. Requirements: · Perl


List::Filter::Storage Related Software