use warnings; use strict; use Text::CSV; my $csv = Text::CSV->new({ binary=>1, auto_diag=>2 }); open my $fh, '<', 'inputfilename' or die $!; my @data; while ( my $row = $csv->getline($fh) ) { push @data, $row; } $csv->eof or $csv->error_diag; close $fh; use Data::Dumper; print Dumper(\@data);