#!/usr/bin/perl -w use strict; use Text::CSV_XS; my $fh; unless (open $fh, "filename") { die "No file available\n"; } my $csv = Text::CSV_XS->new({binary => 1}); my @people; <$fh>; # Drop column names on the floor while ( my $line = <$fh> ) { my $status = $csv->parse($line); my @columns = $csv->fields(); my %h; @h{('Name','Comment')} = @columns; push @people, \%h; } close $fh; print "Name: " . $people[2]->{'Name'} . ", Comment: " . $people[2]->{'Comment'} . "\n";