in reply to Sum fields in Array
Should I reset the variables after it loops through to the next record? If so, how?
It's not clear what you're really trying to acomplish, but I don't see anything being summed. Perhaps you could provide some sample input and expected output.
As far as clearing variables, you should declare them inside the while loop so they are in the smallest scope possible. Declaring the variables at the beginning like you have done essentially makes them all globals.
my @fields; while (my $pimrpt = <PM>) { my ($systime,$company, $company_prev, ... ); ... etc
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Sum fields in Array
by drodinthe559 (Monk) on Feb 04, 2010 at 22:32 UTC |