# list your headers my @heading = qw[description billing_code user_id project_id bad_proj bad_bill bad_user]; # now prepare a statement *once* my $sth = $dbh-execute( map { $row{$_} } @heading ); }