To search
You are here : Linux > Linux > Programming > DBIx::Table2Hash 1.17

DBIx::Table2Hash 1.17

Soft112 rating:
License:
Perl Artistic License
Added:
Nov 30, -1
Submit date:
Jun 15, 2012
Publisher:
Ron Savage
File size:
Downloads:
24349
 

DBIx::Table2Hash 1.17

by Ron Savage

DBIx::Table2Hash is a Perl module that reads a database table and stores keys and values in a hash.

Synopsis

 #!/usr/bin/perl

 use DBIx::Table2Hash;

 my($key2value) = DBIx::Table2Hash -> new
 (
 dbh => $dbh,
 table_name => $table_name,
 key_column => 'name',
 value_column => 'id'
 ) -> select();

 # or

 my($key2hashref) = DBIx::Table2Hash -> new
 (
 dbh => $dbh,
 table_name => $table_name,
 key_column => 'name',
 ) -> select_hashref();

 # or

 my($key2tree) = DBIx::Table2Hash -> new
 (
 dbh => $dbh,
 table_name => $table_name,
 key_column => 'name',
 child_column => 'id',
 parent_column => 'parent_id',
 skip_columns => ['code']
 ) -> select_tree();


The aim is to create a hash which is a simple look-up table. To this end, the module allows the key_column to point to an SQL expression.

select() and select_hashref() do not nest the hash in any way.

select_tree() returns a nested hash. select_tree() will call select_hashref() if necessary, ie if you have not called select_hashref() first.


Product's homepage

Requirements:

· Perl

What's New in This Release: [ read full changelog ]

· Remove text 'All rights reserved' (for Debian licensing).
· Remove POD heads 'Required Modules' and 'Changes'.

Languages:

OS requirements for DBIx::Table2Hash 1.17:

  • Download DBIx::Table2Hash 1.17

User comments about DBIx::Table2Hash 1.17

Comment DBIx::Table2Hash 1.17

  1. What did you think of the program?

    Log in or Create Account to post a comment.
         
    *
    *
  2. Rate this software    
  1. Security Code: Captcha Image Change Image

Get Our News, Everywhere

Linux

Programming

  • 500,000 monthly users
  • More 2,000,000 downloads monthly
  • More 250,000 programs, softwares, apps