in reply to Low-threshold function in Text::CSV_XS

My only question when reading on the CB what what happens with duplicate keys. Perhaps a non-default mechanism to allow for it to emit an HoAoH. LA's case assumes (or ensures, take your pick) no duplicates, so it is a non-issue for her. Update: Quite right Tux. I skipped over the map line and took it as what was returned.

My only other issue would be with the name. csv2list implies that it is returning a list. It is returning a hash (well, hashref), not a list.

--MidLifeXis

Replies are listed 'Best First'.
Re^2: Low-threshold function in Text::CSV_XS
by Tux (Canon) on Jan 24, 2014 at 21:13 UTC

    No, it returns an arrayref: a reference to a list of either anonymous hashes OR a list of anonymous arrays.

    And - I agree with tye and BrowserUK - if it not exported by default, the simple name csv would do quite well.

    As it is a list, duplicate keys are not a problem, unless you want a list of hashrefs and the fields contain duplicate names. In that case, the function provides an attribute to pass the field names yourself.


    Enjoy, Have FUN! H.Merijn

      Absolutely correct. E_READ_ERR. My post updated.

      --MidLifeXis