my $sth = $dbh->prepare("SELECT `Test-Column-1`, `Test-Column-2` FROM `" .$config{'MySQL.table'}."` WHERE 1"); if (!$sth->execute()) { die "Error: ". $sth->errstr ."\n"; } my ($column_1, $column_2); # Bind Perl variables to columns: $sth->bind_columns(\$column_1, \$column_2); my %row; # Column binding is the most efficient way to fetch data while ($sth->fetch) { $row{$column_1} = $column_2; } print Dumper \%row; __END__ $VAR1 = { 'value-1 Column1' => 'value-1 Column2', 'value-2 Column1' => 'value-2 Column2', 'value-3 Column1' => 'value-3 Column2' };