in reply to Text::CSV and getline_hr_all

->getline() returns an array ref not an array

use strict; use warnings; use Data::Dumper; use Text::CSV; my $file = $ARGV[0]; my $csv = Text::CSV->new ({ sep_char => '|', allow_whitespace => 1, binary => 1, eol => "|$/", allow_loose_quotes => 1, ## <--add }); open my $csv_file, "<", $file or die "Cannot open [$file] [$!]"; my $headers = $csv->getline($csv_file) or die "no header"; $csv->column_names($headers); my $table_ref = $csv->getline_hr_all($csv_file); close $csv_file; print "headers: ".Dumper( $headers ); print "table: ".Dumper( $table_ref );
poj