7.12. process csv file (short version)

Example 7-8. examples/arrays/process_csv_file_short.pl

while (<>) {
    $sum += (split ",")[2];
}
print "$sum\n";


Use the following command to run the script:

perl examples/arrays/process_csv_file_short.pl examples/arrays/process_csv_file.csv

See also the oneliners