LINUX CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>

7-DAY TOP DOWNLOAD

#
Program
BackTrack 3.0 / 4.0
Pre-Final

5,487
Ubuntu 9.10
4,487
VLC 1.0.3
3,388
Wine 1.0.1 / 1.1.32
2,824
Yahoo Messenger
1.0.4

2,483
Adobe Flash Player
for Linux 10.0.32.18

2,320
Thunderbird PST
Import plugin 1.2

2,290
Mandriva Linux
2010.0

1,992
Super Grub Disk
0.9799

1,577
Yellow Dog Linux 6.2
1,441

WEEK'S BEST

  • Ubuntu 9.10
  • Ubuntu Netbook Rem...
  • Pidgin 2.6.3
  • Wine 1.0.1 / 1.1.32
  • Linux Kernel 2.6.3...
  • Mozilla Firefox 3....
  • Fedora 11
  • OpenOffice.org 3.1.1
  • Firestarter 1.0.3
  • The Gimp 2.6.7 / 2...
  • FileZilla 3.2.8.1 ...
  • Transmission 1.76
  • Super Grub Disk 0....
  • Gufw 9.04.2
  • Skype 2.0.072 / 2....
  • openSUSE Linux 11....
  • Opera 10.01 / 10.1...
  • Adobe Flash Player...
  • wine-doors 0.1.3
  • Google Gadgets 0.1...
  • Home / Linux / Programming / Perl Modules

    List::Filter::Storage 0.04

    Download button

    No screenshots available
    Downloads: 123  Add to download basket  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.8/5)
    10 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Joseph Brenner | More programs
    Perl Artistic License / FREE
    April 23rd, 2008, 15:24 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Add a review  Refer to a friend  Subscribe

     

    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 => [ $stash_file ],
    });
    my $filter = List::Filter->new(
    { name => 'skip_boring_stuff',
    terms => ['-.vb$', '-.js$'],
    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 =>
    [ $stash_file ] });

    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=> [
    $yaml_file,
    { format => 'DBI',
    connect_to => $connect_to, # e.g. "dbi:Pg:dbname=$dbname"
    owner => $owner,
    password => $password,
    },
    ] } );


    # storage format "MEM" keeps data in memory only
    my $lfs = List::Filter::Storage->new( {
    storage=> [
    [
    { format => 'MEM',
    connect_to => {},
    }
    ] });

    # 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 => [ $yaml_file,
    { format => 'DBI',
    connect_to => $connect_to,
    owner => $owner,
    password => $password,
    },
    ],

    } );

    # a storage handler can save objects of type 'transform'
    # (a child of filter):
    my $storage_tran = List::Filter::Storage->new(
    { storage => [ $stash_file ],
    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

      


    TAGS:

    storage handler | filters storage | Perl module | filters | storage | handler



    HTML code for linking to this page:


    Go to top

    Windows tabGames tabDrivers tabMac tabLinux tabScripts tabMobile tabHandheld tabGadgets tabNews tab

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   ENTER NEWS SITE   |   ENGLISH BOARD   |   ROMANIAN FORUM