in reply to Printing particular column is not working
That slurps the entire file into the array, not just the first line.
Try: my $header = shift <FH>;
Or: my @header = split(/,/, shift <FH>);
Or the better option as has already been suggested would be to use the Text::CSV module or one of its brethren.
|
|---|