$ cat test.pl #!/pro/bin/perl use strict; use warnings; use autodie; use Text::CSV_XS; my $csv = Text::CSV_XS->new ({ binary => 1 }); open my $fh, "<", "test.csv"; $csv->column_names ($csv->getline ($fh)); while (my $h = $csv->getline_hr ($fh)) { print "$h->{Name} => $h->{Cost}, $h->{Inventory}\n"; } $ cat test.csv Name,Cost,Inventory pickles,2.99,12 vegemite,4.00,8 nuclear sub,22.50,4 $ perl test.pl pickles => 2.99, 12 vegemite => 4.00, 8 nuclear sub => 22.50, 4 $