#!/usr/bin/perl -w #use strict; #use warnings; #use diagnostics; use Text::CSV_XS; my $file = 'test.csv'; #csv file name my @rows; # array that will store csv values my $csv = Text::CSV_XS->new ({ binary => 1 }) or die "Cannot use CSV: ".Text::CSV->error_diag (); #open file open my $FH, "<:encoding(utf8)", "$file" or die "$file: $!"; #read file in while loop my $i = 1; while (my $row = $csv->getline ($FH) ) { if ($i > 42) {push @rows, $row;} $i++ } $csv->eof or $csv->error_diag (); #close file close $FH; #print contents of @rows array for my $print_rows (@rows) { print "@$print_rows\n"; }