use Text::xSV; my $csv = Text::xSV->new( filename => "foo.csv", header => \@column_names, ); while ($csv->get_row()) { # You could use fetchrow_hash here, but I'll just print a message # If you want a HoH or AoH, read up on extract_hash my ($name, $alert_publisher) = $csv->extract(qw(Name alert_publisher)); print "Dll: $name\t is " . (($alert_publisher eq 'X')? '' : 'not ') . "an alert publisher\n"; }