|go ahead... be a heretic|
Re^3: DBD::CSV - how to I coax it to read BOM prefixed files?by afoken (Chancellor)
|on Jun 09, 2017 at 20:28 UTC ( #1192444=note: print w/replies, xml )||Need Help??|
Worked like a charm. Thank-you
Glad I could help.
Until Tux' change is released on CPAN, please do yourself a favour and add an explaining comment how that trick works. This trick is everything but obvious, and I doubt that it will work for any combination of the relevant modules. Don't make your future self invent a time machine to come back and hurt you for playing dirty tricks.
When the change is released, test it, get rid of my dirty trick, and explicitly require the new version of DBD::CSV.
If your code has to work with "any" version of DBD::CSV, check its version, prefer to use the Tux' official csv_bom attribute, and only if it is not supported, fall back to use the File::BOM trick. Something like this:
Alternatively, patch DBD::CSV at runtime if it is too old, and use Tux' official attribute csv_bom even with old versions:
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
In Section Seekers of Perl Wisdom