amcleod has asked for the wisdom of the Perl Monks concerning the following question:
A minor, but annoying issue:
I want to start using POD documentation in my projects, but the simplest attempt results in a warning message when trying to display the documentation:
Pressing Y displays the documentation as expected. Pressing ENTER twice causes output to be displayed with the ANSI sequences munged by removing the ESC characters.
$ perldoc perltest "/tmp/dACGXRf5qF" may be a binary file. See it anyway? more: unknown option -R Usage: more [options] <file>... A file perusal filter for CRT viewing. Options: -d display help instead of ringing bell -f count logical rather than screen lines -l suppress pause after form feed -c do not scroll, display text and clean line ends -p do not scroll, clean screen and display text -s squeeze multiple blank lines into one -u suppress underlining -<number> the number of lines per screenful +<number> display file beginning from line number +/<string> display file beginning from search string match -V display version information and exit For more details see more(1). "/tmp/dACGXRf5qF" may be a binary file. See it anyway? ?[1mNAME?[0m The quick brown fox jumps over the lazy dog. ?[1mSYNOPSIS?[0m The quick brown fox jumps over the lazy dog. ?[1mDESCRIPTION?[0m The quick brown fox jumps over the lazy dog. ?[1mAUTHOR?[0m The quick brown fox jumps over the lazy dog.
Note the '?' characters where the ESC characters would be expected. And here is the simple program I am using to test:
#!/usr/bin/perl -w use feature 'say'; =head1 NAME The quick brown fox jumps over the lazy dog. =head1 SYNOPSIS The quick brown fox jumps over the lazy dog. =head1 DESCRIPTION The quick brown fox jumps over the lazy dog. =head1 AUTHOR The quick brown fox jumps over the lazy dog. =cut say "Testing..."; exit;
I can see no reason for the resulting documentation to be considered binary. The only think in the output that I can see that is even close are the ESC characters in the ANSI sequences and they are simple control characters, which I doubt are an issue for the terminal. Running perldoc perlpod produces nothing on the matter. Googling has turned up no suggestions, far less answers.
Sure, I can just press Y and the documentation is displayed, but that is simply accepting the issue instead of trying to correct it.
Anyone got an idea what I'm doing wrong, or how this can be solved?
(By the way, I occasionally see this same behaviour with other POD documentation from other sources, but it is thankfully rare.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Binary File warning when using POD documentation
by LanX (Saint) on Sep 05, 2021 at 16:07 UTC | |
by amcleod (Novice) on Sep 05, 2021 at 16:51 UTC | |
by LanX (Saint) on Sep 05, 2021 at 17:08 UTC |