|Just another Perl shrine|
Text::CSV_XS function does not accept headers and key togetherby Lady_Aleena (Curate)
|on Jun 07, 2017 at 09:03 UTC||Need Help??|
Lady_Aleena has asked for the
wisdom of the Perl Monks concerning the following question:
Hello. In my effort to improve my perl writing, I was going to take some of my own advice and stop trying to find reasons to not use something. With that in mind, I finally decided to look into Text_CSV_XS to replace my hand rolled flat file processor. I gravitated right to the function csv in the module as it looked easier to use. However, I came upon a problem. In the POD it says that when key is set, headers is set to auto, so the headers I set would not work.
So, other than going through every flat file I have and adding the headers, can anyone think of a way to work around? I have so very many flat files and could possibly miss a few, so adding headers in now would be problematic.
What I want is a hash of hashes with the first item on each line to be the key to the hash along with being a named value in the hash.
Is there maybe someone who would hold my hand as I try to work through the method in Text::CSV_XS?
Update: This is as far as I have gotten with the method version.
No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!