in reply to Help paring down massive subroutine

In terms of actually reducing the overall bulk, the first loop over @day_prefixes seems to be quite long with a lot of repetitive stuff.

Given how nicely you have kept variable names, param names and DB field names consistent, I'd wager that you'll find it fairly easy to reduce quite a bit of that code into a nested loop over these names. Use a hash keyed by field name to store values that should be sent to the DB, rather than using separate scalars named for each field -- e.g.:

$sql_statement = "update timecard set " foreach $fname ( keys %fieldhash ) { $sql_statement .= "$fname = $fieldhash{$fname}," if ( $fieldhash{$ +fname} ); } $sql_statement =~ s/,$/ WHERE /; $sql_statement .= "blah = blah etc...";
You might even find a way to extend the use of that hash so that the field names involved appear only once or twice in the whole subroutine, rather than several times (and likewise for other parameter/field sets). Personally, I always find it a nice feature when I can reduce the number of times that I write a given set of names in a script.