in reply to easier to get data from a database

correct me if i'm wrong (and in that case please explain what you DB_GET function returns), but i believe this is just:
use DBI; my ($db_name,$host_name,$port,$db_user,$db_pass,) = @_; my $database = "DBI:mysql:$db_name:$host_name:$port"; my $dbh = DBI->connect($database,$db_user,$db_pass); my ($table, $col, $value) = ('clients', 'client_id', $client_id); my $sql = "select * from $table"; if( $value ){ $sql .= " where $col = ?"; push @bind, $value; } my $href = $dbh->selectall_hashref($sql, $col, {}, @bind);
I'm not sure exactly though.. it doesn't appear to me that your code works if trying to select out all the rows.. But be sure to read through the DBI docs (perldoc DBI) and look at all the select* methods available.

Other modules to be aware of: SQL::Abstract, Class::DBI, Class::DBI::Autoloader