in reply to Re: Skip problematic lines while populating database
in thread Skip problematic lines while populating database

The last section of Text::CSV_XS' docs for dumping databases notes how to load special exports, e.g. where \N denotes NULL.

You do not need to read the entire input datafile into memory, you can do it streaming:

use Text::CSV_XS qw( csv ); # Make sure the field order matches the TSV order my $sth = $dbh->prepare (...); # See Corions post csv ( in => "file.tsv", out => undef, sep => "\t", on_in => sub { $sth->execute (@{$_[1]}) }, );

Enjoy, Have FUN! H.Merijn