in reply to Re^3: seek() functionality on pipes
in thread seek() functionality on pipes

I'm never quite sure whether Perl will start treating input as unicode without a specific request on an open to do so?

None of the default PerlIO layers do any conversions except :crlf.

However, there could be action at a distance (such as from an open pragma).

That's why binmode should be used on file handles containing binary data (such as the OP's compressed file). It avoids any such problem.

For example, does it recognise BOMs in an input stream and act upon them?

:encoding(UTF-16) uses the BOM to determine byte ordering, but something needs to tell open to use :encoding(UTF-16) first.

Replies are listed 'Best First'.
Re^5: seek() functionality on pipes
by BrowserUk (Patriarch) on Jul 21, 2008 at 19:46 UTC
      Or $ENV{PERLIO}.