http://qs1969.pair.com?node_id=976770


in reply to How to convert non-ASCII output from qx

"why doesn't Perl handle this conversion itself by determining what command output encoding is in effect and converting as needed?"

How could it even reliably determine whether the output was text? A command launched via qx could easily be outputting binary data (e.g. an image; some compressed data; etc). "Converting encoding" on binary data is very likely to corrupt it.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'