in reply to Regex problem
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..$#dat +a]; warn "fields contain non-numeric data: @not_numeric", next if @not_num +eric;
(There are better ways to check if something is numeric, this was just quick'n'dirty since I don't know your real requirements.)
Or, if you want to go the CPAN route, Text::CSV::Simple and several other modules exist.
|
|---|