When you have a lot of similar names like this:
$D_agc =~ s/\s*$//;
$D_market =~ s/\s*$//;
$D_analysis_code =~ s/\s*$//;
$D_item =~ s/\s*$//;
$D_customer =~ s/\s*$//;
$D_key_val2 =~ s/\s*$//;
$D_key_val3 =~ s/\s*$//;
$D_terms_code =~ s/\s*$//;
$D_audit_seq =~ s/\s*$//;
$D_aud_date =~ s/\s*$//;
$D_aud_time =~ s/\s*$//;
$D_opr_id =~ s/\s*$//;
$D_action =~ s/\s*$//;
$D_column_name =~ s/\s*$//;
$D_new_value =~ s/\s*$//;
$D_old_value =~ s/\s*$//;
$D_tot_canc_qty =~ s/\s*$//;
$D_tot_ord_qty =~ s/\s*$//;
$D_tot_ship_qty =~ s/\s*$//;
$D_ship_complete =~ s/\s*$//;
$D_unit_price =~ s/\s*$//;
It's a clue that you have a data structure, not a bunch of unrelated scalars. Consider the use of a proper hash to hold these items.
-- Randal L. Schwartz, Perl hacker
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.