in reply to Re^13: How do I display only matches (updated)
in thread (SOLVED) How do I display only matches

And what happens when you're reading from a mounted partition?

Those who want raw data use binmode or :raw

All others gamble

  • Comment on Re^14: How do I display only matches (updated)

Replies are listed 'Best First'.
Re^15: How do I display only matches (updated)
by soonix (Chancellor) on Sep 30, 2019 at 06:55 UTC
    Technically, even / is a mount point — or are you talking about the (raw) devices?
Re^15: How do I display only matches (updated)
by jcb (Parson) on Oct 01, 2019 at 23:57 UTC

    You are wrong. The binmode FILEHANDLE operator in Perl is a no-op on POSIX, just as the binary mode option to fopen(3) is a no-op on POSIX. I said this was a portability problem, and it is a portability problem, but programs that never use binmode will handle binary data just fine on POSIX. They will fail on other systems where text and binary streams are actually different.

      The binmode FILEHANDLE operator in Perl is a no-op on POSIX

      Sorry, no - it still removes any non-default layers that may be present on the filehandle. Even a handle opened with the default open my $fh, '<', ... can have layers other than the normal defaults present due to the PERLIO environment variable or the open pragma.

        So it is now equivalent to binmode FILEHANDLE, ':raw'? Point accepted, although it was a no-op when I learned Perl in the 5.6 era and seems to remain so absent the special configuration that you mention.

        None of my scripts omitting binmode on POSIX have blown up, but I do not have PERLIO set nor do those scripts use open. (Nor will those scripts ever be distributed in their current forms, as I know that they are not portable.)