in reply to csv to hash table

G'day waytoperl,

Firstly, for manipulation of CSV files in Perl, you should be using one of the Text::CSV family of modules. There's all sorts of gotchas with CSV files, including field separators embedded within the field data, various quoting mechanisms and so on. All this has already been coded in these modules, so there's really no point in reinventing this particular wheel.

While I haven't used it myself, it looks like "Text::CSV::Hashify - Turn a CSV file into a Perl hash", which is built upon Text::CSV, might handle your specific requirements in this instance.

[Aside: Your OP mentions an error: you don't show the error nor do you provide runnable code that we could use to reproduce it. For future reference, in order to help us help you, please follow the guidelines in "How do I post a question effectively?".]

-- Ken