in reply to Coding for maintainability

Personally, I don't like how you're setting $where_statement, with all those additional appends. I'd prefer to use a HERE doc for multi-line chunks of embedded source code, e.g.

my $dt_min = $format_date->format_datetime( $dt_set->min ); my $dt_max = $format_date->format_datetime( $dt_set->max ); my $where_statement = <<EOF; where ir.ir_id = cm.call_master_id and ir.closed_date is not NULL and (ir.closed_date >= '$dt_min' and ir.closed_date < '$dt_max' ) and cm.user_id = ? EOF

JMHO, of course.

We're building the house of the future together.