Perldoc creates intermediate files in /tmp which consequently are opened by less. In case I use "perldoc -q", files starting with 0x1B 0x5B 0x21 0x6D are created (to set the terminal bold, I suspect). This makes less warn with a "may be a binary file" message, asking me if I want to see the file anyway. (Yes, a quick fix would be to define an alias for less to "less -f".) On a Debian system, perldoc (same version) does not generate these escape sequences to make some text bold. This does not make less warn and I can copy the temporary file from my Debian to my Gentoo box and see thinks formatted. My perl version is 5.8.8-r2, perldoc -v gives Pod::Perldoc v3.14. gentoo: $ perldoc -q load | hexdump | head -n3 0000000 5b1b 6d31 6f46 6e75 2064 6e69 2f20 7375 0000010 2f72 696c 2f62 6570 6c72 2f35 2e35 2e38 0000020 2f38 6f70 2f64 6570 6c72 6166 3271 702e debian: $ perldoc -q load | hexdump | head -n3 0000000 0846 6f46 6f08 0875 6e75 6e08 0864 2064 0000010 0869 6e69 6e08 2f20 2f08 0875 7375 7308 0000020 0872 2f72 2f08 0873 6873 6808 0861 7261 Reproducible: Always Steps to Reproduce:
Created attachment 120864 [details] Example that reproduces the same affect without perldoc The problem isn't perldoc -its less that's at fault here. Consider the attached file - in more, it displays a pretty colored Hello. If you vi the file, you can see its just a series of ascii escape sequenced color settings. But if you less the file, less complains that its a binary file.
base-system folks, adding you to the bug (see my last above re: less) in case you have any comments (not sure if this is really a bug in less or not, please weigh in). perldoc itself just relies on whatever is set to the PAGER var in your shell, fwiw.
less-403 seems to fix this ... re-open if you disagree ;)
I agree, it's fixed in less-403. Thanks!