SamCG has asked for the wisdom of the Perl Monks concerning the following question:
I did run a google search for "BOM 2550", and anticipate the FBI will be here soon. ;) I hope they know Perl.UTF-16:Unrecognised BOM 2550 at H:\script\exceptions.pl line 64, <FIL> + line 127 7.
to open the file.open FIL, $_ or die "could not open $_: $!\n"; binmode FIL, ":encoding(UTF-16)";
Anyone know what it means, or how I can fix it?Another consequence of using binmode() (on some systems) is that speci +al end-of-file markers will be seen as part of the data stream. For s +ystems 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 $\ varia +bles in the perlvar manpage for how to manually set your input and ou +tput line-termination sequences.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: binmode file read error message
by BrowserUk (Patriarch) on Jan 20, 2006 at 15:52 UTC | |
|
Re: binmode file read error message
by nobull (Friar) on Jan 20, 2006 at 18:48 UTC |