# This is my means of a sort of 'bind params by column name'. sub bind_result_columns { my $sth = shift; my $RESULT_MAP = shift; my $bound_fields = {}; while (my ($node_field, $db_col) = each %$RESULT_MAP) { $db_col = lc $db_col; if (defined $sth->{NAME_lc_hash}{$db_col}) { $sth->bind_col( $sth->{NAME_lc_hash}{$db_col} + 1, \$bound_fields->{$node_field} ); } else { die "DB column $db_col not returned from your SQL query!\n"; } } return $bound_fields; }