my @data = split /,/; # How do you validate your data? Do you need to? warn "bad line", next if @data != 15; # or something... my @not_numeric = grep { length $_ == 0 || /[^-\d\.]/ } @data[2..$#data]; warn "fields contain non-numeric data: @not_numeric", next if @not_numeric;