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

The default on *nix is equivalent to using :raw, which also creates a portability issue since binmode is unnecessary for handling binary data on POSIX — it "just works" until

Thanks for explaining this puzzling behavior, as seen by fiddling with haukex's oneliner (on darwin):


perl -wMstrict -MData::Dump -e "dd PerlIO::get_layers(STDOUT)"
("unix", "perlio")

perl -wMstrict -MData::Dump -e "STDOUT->binmode(':raw');dd PerlIO::get_layers(STDOUT)"
("unix", "perlio")

perl -wMstrict -MData::Dump -e "STDOUT->binmode(':utf8');dd PerlIO::get_layers(STDOUT)"
("unix", "perlio", "utf8")

perl -wMstrict -MData::Dump -e "STDOUT->binmode(':encoding(UTF-8)');dd PerlIO::get_layers(STDOUT)"
("unix", "perlio", "encoding(utf-8-strict)", "utf8")
  • Comment on Re^14: How do I display only matches (updated)