sub validate_data { my ($self, $fh) = @_; my $csv = new Text::CSV_XS({sep_char => "\t"}); my $headings = <$fh>; # Pull the column names off the top $csv->parse($headings) or return; my @headings = $csv->fields(); print STDERR Dumper(\@headings); # EXAMPLE LINE 1 while(my $line = <$fh>) { if($csv->parse($line)) { my %hash; my @fields = $csv->fields(); print STDERR Dumper(\@fields); # EXAMPLE LINE 2 } } return 1; }