At 13:14 03/02/18 -0800, Jonathan Coxhead wrote:
That's a very long-winded way of writing it!

How about this:

#!/usr/bin/perl -pi~ -0777
# program to remove a leading UTF-8 BOM from a file
# works both STDIN -> STDOUT and on the spot (with filename as argument)
s/^\xEF\xBB\xBF//s;

which uses perl's -p, -i and -0 options to the same effect.
Yes, indeed, that's perfect. I was thinking about something
in that direction, but never got to check it out, sorry.

Regards,   Martin.

Reply via email to