Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Class::DataStore 0.07

    Download button

    No screenshots available
    Downloads: 406  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Eric Folley | More programs
    Perl Artistic License / FREE
    October 6th, 2006, 07:05 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Class::DataStore description

    A Perl module for generic OO data storage/retrieval.

    Class::DataStore is a Perl module for generic OO data storage/retrieval.

    SYNOPSIS

    my %values = ( one => 1, two => 2 );
    my $store = Class::DataStore->new( %values );

    # using get/set methods
    $store->set( 'three', 3 );
    my $three = $store->get( 'three' );

    # using AUTOLOAD method
    $store->four( 4 );
    my $four = $store->four;
    my @four = $store->four; # returns a list

    my $exists = $store->exists( 'three' ); # $exists = 1
    my $data_hashref = $store->dump;
    $store->clear;


    Class::DataStore implements a simple storage system for object data. This data can be accessed via get/set methods and AUTOLOAD. AUTOLOAD calls are not added to the symbol table, so using get/set will be faster. Using AUTOLOAD also means that you will not be able to store data with a key that is already used by a instance method, such as "get" or "exists".
    This module was written originally as part of a website framework that was used for the Democratic National Committee website in 2004. Some of the implementations here, such as get() optionally returning a list if called in array context, reflect the way this module was originally used for building web applications.

    Class::DataStore is most useful when subclassed. To preserve the AUTOLOAD functionality, be sure to add the following when setting up the subclass:

    use base 'Class::DataStore';
    *AUTOLOAD = &Class::DataStore::AUTOLOAD;
    This module is also a useful add-on for modules that need quick and simple data storage, e.g. to store configuration data:
    $self->{_config} = Class::Datastore->new( $config_data );
    sub config { return $_[0]->{_config}; }
    my $server = $self->config->server;
    my $sender = $self->config->get( 'sender' );


    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    OO data storage | OO data retrieval | Perl module | Class::DataStore | OO | data

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM