foreach $line (@lines){ chomp $line; $count++; next unless $count; # skip header in csv my $row; @$row = split(/,/, $line ); push @$sheet2 , $row; }