Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Libraries

    MLDBM::TinyDB 0.20

    Download button

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

    License / Price:

    Last Updated:

    Category:
    Darek Adamkiewicz | More programs
    Perl Artistic License / FREE
    July 13th, 2007, 02:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    MLDBM::TinyDB description

    MLDBM::TinyDB is a Perl module that can help you to create and manipulate structured MLDBM tied hash references.

    MLDBM::TinyDB is a Perl module that can help you to create and manipulate structured MLDBM tied hash references.

    SYNOPSIS

    use MLDBM::TinyDB;
    ## or
    use MLDBM::TinyDB qw/db add_common/;

    @common = qw/created updated/; ## optional

    $tree = [TABLE, FIELDS_LIST,
    [TABLE1, FIELDS_LIST1,
    [TABLE2, FIELDS_LIST2],
    ...
    ],
    ...
    ];

    MLDBM::TinyDB::add_common($tree,@common); ## optional
    ## or
    add_common($tree,@common);

    %obj = ();
    $obj{TABLE} = MLDBM::TinyDB->init(TABLE, $tree);
    ## or
    $obj{TABLE} =
    MLDBM::TinyDB->init(TABLE, $tree, undef, $mode, $perms);
    ## or
    $obj{TABLE} = MLDBM::TinyDB->init(TABLE); ## NEVER FIRST TIME

    @down = $obj{TABLE}->down; ## TABLE1

    $obj{TABLE1} = MLDBM::TinyDB::db(TABLE1);
    ## or
    $obj{TABLE1} = db(TABLE1);

    $table = $obj{TABLE}->table; ## TABLE

    @down = $obj{TABLE1}->down; ## TABLE2

    $obj{TABLE2} = MLDBM::TinyDB::db(TABLE2);
    ## or
    $obj{TABLE2} = db(TABLE2);

    @set_recs_indices =
    $obj{TABLEn}->set_recs(ARRAYREF_TO_HASHREF,[LIST]);

    $up = $obj{TABLE2}->up; ## TABLE1

    $aref_of_href = $obj{TABLE}->get_ext_recs;
    ## or
    ($aref_of_href, @get_recs_indices) = $obj{TABLE}->get_ext_recs;

    $aref_of_href1 = $obj{TABLE}->get_recs; ## NOT THE SAME AS ABOVE
    ## or
    ($aref_of_href1, @get_recs_indices1) = $obj{TABLE}->get_recs;

    @indices_of_recs_found = $obj{TABLE}->search($criteria, [$limit]);
    @indices_of_recs_found = $obj{TABLE}->lsearch($criteria, [$limit]);

    @indices_and_sort_field_values = $obj{TABLE}->sort($sort_formula_string);
    @indices_and_sort_field_values = $obj{TABLE}->lsort($sort_formula_string);

    $obj{TABLEn}->delete([LIST]);
    $obj{TABLEn}->last;

    MLDBM::TinyDB is MLDBM based module. It allows to create/manipulate data structure of related tables = more-then-flatfile-database. The main idea is to create array reference which will reflect database structure. The first scalar value in the array is table name, next ones are fields names - if the array contains array reference it denotes interior (related) table where first scalar value is that table name (in that case the record will contain the field of the same name as interior table) and the next ones are fields names and so on... If database structure isn't written on disk then that structure is fetched from the array reference and written to disk.

    Object is always built from disk structures. To define record you may use any field name except "nodes" which is restricted field name and shouldn't be specified explicitly. created and updated fields are handled internally - if they are specified then: 1)on append record operation time function value is set to created record field 2)on write to existing record operation time function value is set to updated record field. Data get from and set to records are in form of array reference to hash references where hash keys are fields names. The fields names that are interior tables names contain array references. That array store indices (similar to array indices) identifying particular records. Those fields MUST be set to proper values before write records set_recs operation.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    create hash references | manipulate hash references | Perl module | MLDBM::TinyDB | MLDBM | hash

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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