http://qs321.pair.com?node_id=659101

trey5498 has asked for the wisdom of the Perl Monks concerning the following question:

I am currently trying to learn Perl (never done until now) and I wrote a small peice of code that I want to read in from an CSV file and place it into an array. At this time I want to print each line of the array so that I know that I am doing it right. Later I will putting it into an output.csv with some changes made. Here is the code which doesnt seem to working right. PLEASE HELP!!!!!!!!!!!!

Code

use Text::CSV; my @printerstat; $file = 'inputdata.csv'; my $csv = Text::CSV->new(); open (FILE, $file) or die "Couldn't open location file: $!"; while (<FILE>) { $csv->parse($_); push(@printerstat, [$csv->fields]); print @printerstat; } close FILE;