On Monday, October 6, 2003, at 07:01 AM, Carl Jolley wrote:


On Fri, 26 Sep 2003, Ken Cornetet wrote:

I suppose you could get fancy and use DBI and DBD-CSV.


Why complicate a simple task? Unless of course, you're trying to deliberatly make life difficult for the next person who will have to maintain your code. Unnecessary "fancy" is rarely appreciated by other than the party of the first part OTOH, simplistic elegance is widely admired.

Yes, but in this case there may be a reason to use modules. If the files that his is parsing have text data other than numbers it can get very complicated to parse CSV files. As I recall, CSV does allow commas to be included in text strings -- so first, you have to figure out where the strings are (ie, break on the '"' character, then determine which are opening and closing quotes, and which may just be quotes inside a string, via escaping or duplicating), then you can figure out where the columns are. This is why I prefer tab-delimited, because I can think of _very_ few situations where a tab character is valid data. However, if he is going to use CSV, using a module which has dealt with all of the special cases may make sense.


In addition, by bulding around DBI, if he suddenly needs to start getting input from some other data source, he may find it much easier to modify his code...

Ricky

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to