#!C:\Perl\bin\perl use warnings; use strict; use Text::CSV_XS; my $file = "file.csv"; open FILE, $file or die "cannot open file\n"; my $first = ; my @columns = split(",", $first); my $csv = Text::CSV_XS->new ( { binary => 1 } ) or die "Cannot use CSV: ".Text::CSV->error_diag (); $csv->column_names(@columns); my $lineNum = 1; while (my $line = ) { my $hr = $csv->getline_hr($line); my $sku = $hr->{ 'sku' }; print "$sku\n"; $lineNum++; } close FILE