http://www.perlmonks.org?node_id=1038779


in reply to removing \n with for each

Why bother extracting columns from a CSV file yourself when people have done it before? See Text::CSV_XS and its incredibly long list of relations.

If you spot any bugs in my solutions, it's because I've deliberately left them in as an exercise for the reader! :-)