in reply to the chomp does not seem to work

chomp removes a newline from the end of the line, and what a newline is is defined by the $/ special variable.

If you're on linux $/ will be a line feed, but the CSV file could have the windows line endings CR LF (carriage return + line feed).

So you either need to adjust $/, or remove a bit more, for example all trailing spaces:

$line =~ s/\s+$//;