Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 180235 - perldoc -q makes less warn about binary files
Summary: perldoc -q makes less warn about binary files
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Perl team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-29 16:13 UTC by Jan
Modified: 2007-06-17 11:35 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Example that reproduces the same affect without perldoc (test-example,46 bytes, text/plain)
2007-06-01 11:48 UTC, Michael Cummings (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan 2007-05-29 16:13:32 UTC
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:
Comment 1 Michael Cummings (RETIRED) gentoo-dev 2007-06-01 11:48:28 UTC
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.
Comment 2 Michael Cummings (RETIRED) gentoo-dev 2007-06-01 11:53:16 UTC
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.
Comment 3 SpanKY gentoo-dev 2007-06-17 00:00:27 UTC
less-403 seems to fix this ... re-open if you disagree ;)
Comment 4 Jan 2007-06-17 11:35:06 UTC
I agree, it's fixed in less-403. Thanks!