my $csv_data = "foo,,bar";
foreach ( split /,/, $csv_data ) {
print "'$_' => ", defined($_), "\n";
}
Gives you
'foo' => 1
'' => 1
'bar' => 1
So that middle value is not undef, but "". Of course, since DBI's results are supposed to be as independent as possible of the underlying data structure, there may -- in fact, should -- be routines within DBD::CSV to convert "" to undef, which is what you'd expect to get if you were using an actual RDBMS. That's assuming it even uses something so crude as that split to get at the data =)
/me is too lazy to look at the source code. |