makamaka / Text-CSV

comma-separated values manipulator
24 stars 19 forks source link

when reading line by line, skip_empty_rows('skip') does not skip a trailing empty row right before EOF #64

Closed bugfood closed 10 months ago

bugfood commented 11 months ago

Given an input file like:

a,b,c,d
1,2,0,4

5,7,9,3

When skip_empty_rows is set to skip, and Text::CSV is reading line by line, the first empty line is skipped, but the second empty line is returned as an empty row rather than undef (EOF).

I will open a PR for this, including tests that illustrate the situation more precisely.

This same bug is present in Text::CSV_XS; I will open a separate bug and PR for that project.

Thanks, Corey