#!/usr/bin/perl use strict; use warnings; use Text::CSV_XS; my $file = $ARGV[0] or die "Usage: $0 "; my $csv = Text::CSV_XS->new({binary => 1}) or die "Unable to instantiate CSV object: ", Text::CSV_XS->error_diag(); open(my $fh, '<', $file) or die "Unable to open '$file' for reading: $!\n"; while(my $row = $csv->getline($fh)) { # Do something with $row }