Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Looking for elegant solution to dbi coding problemby Commander Salamander (Acolyte) |
on Jul 15, 2005 at 22:28 UTC ( [id://475374]=perlquestion: print w/replies, xml ) | Need Help?? |
Commander Salamander has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I was wondering if one of you could advise me on the most elegant solution to the following issue with a small script that it is inputting lines into a MySQL table. I'm currently feeding each line in with this code:
Each line contains a tab-delimited separation of the six fields that I'm inputting. The problem is that when the final field is blank, the split function ignores the empty space to the right of the final "\t", and thus I get an error in MySQL when executing the statement. I hope I'm making sense here. Anyway, I can think of some cumbersome ways to preprocess the lines, but I have this feeling that there is a far more elegant solution to this that I haven't stumbled upon. Any advice would be much appreciated. Thanks!
Back to
Seekers of Perl Wisdom
|
|