Please read the documentation. The undef is very necessary here and refers only to the value for the second argument being passed to the method do. Explaining exactly what that argument is for is difficult, at best. Otherwise you are very very close to understanding how this works. | [reply] |
I might not be getting this fully - I'm trying to go through the cpan documentation for DBI. If you want to insert a NULL value for a particular field you use 'undef' but what if in my case you don't know whether the field will be undefined when you extract if from the CSV file? I need the variable (e.g. '$file_temp_c' from the original code block I included earlier) to be equal to either a value if populated or 'undef' if the CSV file did not have a value. I can test the variable and they do indicate they are undefined but, at least in my original code they do not translate to NULL in the MySQL table - hope this makes sense and is possible.
| [reply] |
| [reply] |