use SQL::Abstract; my $sa = SQL::Abstract->new; # in _lookup(): my $query = "SELECT $indy->{string} FROM $indy->{table} ". "WHERE $indy->{index}=$row->{$fieldName}"; my ($sql, @bind) = $sa->select( $indy->{table}, [$indy->{string}], { $indy->{index} => $row->{$fieldName} } ); my ($val) = $db->selectrow_array( $sql, {}, @bind ); return $val; # in _show_bugs(): my ($query,@bind) = $sa->select('Bug', \@fieldset, {bugid=>[split(/,/,$args)]} ); my $sth = $db->prepare( $query ); eval { $sth->execute(@bind); }; #### sub _show_bugs(){ my $args = shift; my @headers = map { "*$_*" } qw/ ID Title Priority Assignment State /; my $fmt = "| %s | %s | %s | %s | %s |\n"; my $sql =<fetchall_arrayref($sql); # note: is slurping in all rows return join '', map { sprintf $fmt, @$_ } \@headers, @$rows; }