I wrote some CSV-reading code a few weeks ago and used the Text::xSV module instead of our old home-grown logic that we use in other parts of our application. One of the things our old code does is strip out a possible UTF Byte Order Mark at the beginning of the file. I played around with various ways of getting that same result using Text::xSV, which lets you specify a custom pre-processing filter for each line of data. Short of modifying the module, I was never able to figure out a way to apply that filter to only the first line, and eventually settled on applying it to all lines (and hoping that no other line would start with /^\x{EF}\x{BB}\x{BF}/).
Just curious if anyone can think of a clever way to make a Text::xSV filter work on only the first line of the file it's reading?