P is for Practical | |
PerlMonks |
(arturo) Re:(6)Null fieldsby arturo (Vicar) |
on Mar 27, 2001 at 21:40 UTC ( [id://67557]=note: print w/replies, xml ) | Need Help?? |
Heh, how long this thread has gone on ... so, to distinguish null from empty string in CSV, you could to
And write your code so that the second item in that list is NULL, while the fourth is a blank string. Unfortunately I don't know if there's a standard for that or not. I suppose I should try both in DBD::CSV and see what pops up. (update down the road) as promised here's some code ... I think the upshot is that DBD::CSV doesn't distinguish between blank strings and undef values, but I can't tell because the code isn't working ATM. posted for educational purposes only.
As I mentioned, looking at the file that got created, I don't see a difference between blank and undef, EXCEPT in the first two cases: the "Charo" line has a trailing comma, the "Wynonna" line does not. And thanks to busunsl for pointing out I forgot to execute my statement (sigh, it's not the best of days for me when it comes to details). Philosophy can be made out of anything. Or less -- Jerry A. Fodor
In Section
Seekers of Perl Wisdom
|
|