in reply to MySQL: trouble inserting an array with some undefined members into a table using a set number of placeholders

I know that some fields in the text file are empty (e.g. 'foo:bar::bash'). The split should result in an array like this:
("foo","bar","","bash")

It should. But does it? Use Data::Dumper to verify it.

Instead, DBI seems to ignore the "" and only attempts to insert foo, bar, and bash.

I've never seen DBI doing anything like this, and I've just tried it with an example database, it inserted the empty string just fine. Most likely the error is somewhere else in your script.

  • Comment on Re: MySQL: trouble inserting an array with some undefined members into a table using a set number of placeholders
  • Download Code