while () { my $line = $_; # Is this assignment really needed? ($accnt_num, $date_listed, $disposition, $client, $cancel_reason, $amt_paid, $initial_bal, $accnt_bal) =split /","/; if ($date_listed ne $last_date) { write_values_to_another_textfile(); reset_all_variables(); $last_date = $date_listed; } if ($disposition eq "3DL0" or $disposition eq "3DL1") { $NumOfFiles += 1; $PlacementDollar += $initial_bal; $CurrBal += $accnt_bal; } }