http://qs321.pair.com?node_id=11123409


in reply to TexT::CSV and getline

GrandFather has answered the question, so this just another data point.

Text::CSV returns undef when it is passed incorrect arguments. If you had added a print for the $csv as well as $fh then this would have come up as a warning about printing an undefined value. Or you could have added:

die "CSV object is undefined" if !defined $csv;

This is one of those things that is much clearer in hindsight.