That means $csv is undef.
What error do you get during the ->new operation?
In reply to Re: CSV_XS issue by Anonymous Monk in thread CSV_XS issue by wassmp1