Created
April 22, 2015 15:28
-
-
Save Tux/de990d9294125224c129 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Text-CSV6 502 > cat csv-parser.pl | |
#!perl6 | |
use v6; | |
use Slang::Tuxic; | |
use CSV::Parser; | |
my $fh = open "/tmp/hello.csv", :r, chomp => False; | |
my $parser = CSV::Parser.new (file_handle => $fh, contains_header_row => False); | |
my int $r = 0; | |
my int $sum = 0; | |
while (my $rec = $parser.get_line) { | |
$r++; | |
my int $n = +$rec.keys or last; | |
$sum += $n; | |
} | |
$sum.say; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment