Some of your SQL statements look very similar to each other in
sub process_dsa_dsm. You might want to replace the interploted strings with placeholders and pass in the parameters in the execute. This will increase the efficiency of the SQL parsing (as will using table aliases and qualifying all fully column names). Also, I would (personal opinion, of course) refrain from building the SQL directly in the prepare statement, but instead use a scalar variable instead - it can greatly aid debugging, especially when using complex queries, (and, personally I wouldn't be using something as important as
@row so inconsistently - sometimes global, sometimes a parameter).
The parameter passing in update_record can be more easily accomplished using a list assignment, e.g.
my ($new_status,$scr_date,$pros_id,
$tsr_name,$sales_rep_name,$prod_code,
$leadsht_id,$curr_status) = @_;
The code obviously works, so ++ for that, but you might want to reconsider the use of so many globals: maintaining the code as it stands, I believe, would tend to increase the complexity (i.e. increase the 'spagetti'ness).
rdfield