our $stmt = qq/select component, bug_no from request where status like 'OPEN'/; our $sth = $dbh->prepare($stmt); $sth->execute() or die DBI->errstr; my %hash; while( my( $comp, $bug_num ) = $sth->fetchrow_array() ) { $hash{ $comp } = $bug_num; }