my $sgv = $dbh->prepare("show variables"); $sgv->execute(); while (($keyword, $value) = $sgv->fetchrow_array()) { print "$keyword=$value\n"; } I try to do the following... is this right? need help desperately..... my $sgv = $dbh->prepare("show variables"); $sgv->execute(); while (($keyword, $value) = $sgv->fetchrow_array()) { print $keyword, $value; %mysql{$keyword}=$value; print %mysql{"back_log"}; } This is the original output when the command runs in mysql. mysql> show variables; +---------------------------------+------------------------------------------+ | Variable_name | Value | +---------------------------------+------------------------------------------+ | back_log | 50 | | basedir | / | | binlog_cache_size | 32768 | | bulk_insert_buffer_size | 8388608 | | character_set_client | latin1 | | character_set_connection | latin1 | | character_set_database | latin1 | | character_set_results | latin1 | | character_set_server | latin1 |