<DATA> is not a filehandle, it's the <> I/O operator (aka readline) applied to the bareword filehandle DATA. $csv->getline(DATA) may work in your code because you don't have strict turned on (which can cause strange and hard-to-analyze bugs), but since you should always Use strict and warnings, you should use the glob notation to pass bareword filehandles as arguments, i.e. $csv->getline(*DATA). For files you open, nowadays you should always use lexical filehandles - "open" Best Practices.
Minor edits shortly after posting.
Update in response to your edit: Relevant reading is Symbol Tables, Typeglobs and Filehandles, and Passing Symbol Table Entries (typeglobs) (and perlref for globrefs).
In reply to Re: Filehandles and CSV_XS (updated)
by haukex
in thread Filehandles and CSV_XS
by Melly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |