in reply to Re: Re: Help with parsing through a comma delimted file
in thread Help with parsing through a comma delimted file

Your update underscores a point I like to make. Whenever you can, avoid C style loops in favour of Perl's foreach construction. Thus you would write:
foreach my $i (0..$#line) { $record[$row]{$fieldname[$i]}=$line[$i]; }
The reason is that you will make fewer fencepost errors that way. (One of the most common bugs in C, but generally automatically avoidable in Perl.

Beyond that I would recommend using a -1 for the third argument to split, and given that you have tabular data I would lose the loop entirely for a slice:

my %rec; @rec{@fields} = split(/,/, $_, -1); $record[$row] = \%rec;
(I would actually clean it up even more, more on that in another post.)