#!/usr/bin/perl use strict; use warnings; use Text::CSV_XS; my $file = $ARGV[0]; my $xs = Text::CSV_XS->new({'strict' => 1,'auto_diag' => 2}); open(my $handle,$file); $xs->column_names(['one','two','three']); while(my $line = $xs->getline($handle)) { print Dumper($line)."\r\n"; } close($handle);