UTF-16:Unrecognised BOM 2550 at H:\script\exceptions.pl line 64, line 127 7. #### open FIL, $_ or die "could not open $_: $!\n"; binmode FIL, ":encoding(UTF-16)"; #### Another consequence of using binmode() (on some systems) is that special end-of-file markers will be seen as part of the data stream. For systems from the Microsoft family this means that if your binary data contains \cZ, the I/O subsystem will regard it as the end of the file, unless you use binmode(). binmode() is not only important for readline() and print() operations, but also when using read(), seek(), sysread(), syswrite() and tell() (see the perlport manpage for more details). See the $/ and $\ variables in the perlvar manpage for how to manually set your input and output line-termination sequences.