#!/pro/bin/perl use strict; use warnings; use IO::Handle; use Text::CSV_XS; open my $fh, "<", "data.csv" or die "data.csv: $!"; my $csv = Text::CSV_XS->new ({ binary => 1, eol => "\r\n" }); $csv->types ([ Text::CSV_XS::PV (), # Server Text::CSV_XS::IV (), # Count ]); while (my $row = $csv->getline ($fh)) { my ($server, @data) = @$row; $csv->print (*STDOUT, $row); } close $fh; #### # cat data.csv CSFDATVM01,,2.55,3.77 # perl data.pl Argument "" isn't numeric in subroutine entry at xx.pl line 17, <$fh> line 1. CSFDATVM01,0,2.55,3.77 #