in reply to Parse CSV file
Use the module Text::CSV_XS.
use Text::CSV_XS "csv"; # read only column 3 my $aoa = csv (in => "file.csv", fragment => "col=3"); # convert to array of strings my @list = map { $_->[0] } @$aoa;
update: in perl6 that would be:
use Text::CSV; my @list = csv(in => "file.csv", fragment => "col=3").map(*[0]);
Or, better readable (IMHO):
use Slang::Tuxic; use Text::CSV; my @list = csv (in => "file.csv", fragment => "col=3").map (*[0]);
|
|---|