in reply to Re: Read the csv file to a hash....
in thread Read the csv file to a hash....

That's reasonable, but I'd think that instead of
<$fh>; # Drop column names on the floor
the script should read that and parse it, so it gets the column names from the .csv file rather than hardcoding Name and Comment.

Apart from that, that works very nicely, and Text::CSV_XS is much more robust than my //g approach above.


Mike

Replies are listed 'Best First'.
Re^3: Read the csv file to a hash....
by snopal (Pilgrim) on Jul 06, 2007 at 16:28 UTC

    I agree wholeheartedly that a production system should use all available data. Your point is extremely valid. I have almost always applied column header preservation in my production environments.

    I made a design decision here so that I could highlight the storage strategy here over the complexity of the implementation (yet showing off a bit with the assignment).