my %rec = ( emp_id => undef, first_name => undef, monthly_payment => undef ); $sth->execute; $sth->bind_col(1, \$rec{emp_id}); $sth->bind_col(2, \$rec{first_name}); $sth->bind_col(3, \$rec{monthly_payment}); print "$rec{emp_id}\t", "$rec{first_name}\t", "$rec{monthly_payment}\n" while $sth->fetchrow_arrayref;