Perldoc and the pipe "|" character

J

jkstill

While cutting and pasting an example from a script viewed via perldoc,
the example would not work.

The problem was that perldoc was displaying the pipe chr(124) and a
similar character, chr(226).

I have reviewed the docs on perldoc, but have been unable to get any
method to work so that the pipe symbol is properly displayed.

This is on RH Linux ES 4, 2.6 kernel.

Perl is 5.8.8

Here is a snippet from the displayed documentation:

ps -e -o user --no-headers │ sort -u│

As you can see those are not pipes - |

What might be the reason for this, and a solution to get the | to
display properly?
 
L

Larry

While cutting and pasting an example from a script viewed via perldoc,
the example would not work.

The problem was that perldoc was displaying the pipe chr(124) and a
similar character, chr(226).

I have reviewed the docs on perldoc, but have been unable to get any
method to work so that the pipe symbol is properly displayed.

This is on RH Linux ES 4, 2.6 kernel.

Perl is 5.8.8

Here is a snippet from the displayed documentation:

ps -e -o user --no-headers │ sort -u│

As you can see those are not pipes - |

What might be the reason for this, and a solution to get the | to
display properly?

How do you know the author didn't put the bad character in there
himself (by mistake)? If so, Perldoc is simply giving you what the
author put in (GIGO).
 
J

jkstill

How do you know the author didn't put the bad character in there
himself (by mistake)? If so, Perldoc is simply giving you what the
author put in (GIGO).

Because I am the author, and the command was cut and pasted from the
command line into the pod section of the script.

The character in the script is correct.

Try this. Create a file called pod_pipe.pl with nothing in it but a
pod section:


jkstill-6 > cat pod_pipe.pl

=head1 Does the pipe display correctly?

this is a pipe: |

=cut

Now here is the output from perldoc:

POD_PIPE(1) User Contributed Perl Documentation
POD_PIPE(1)

Does the pipe display correctly?
this is a pipe: │

perl v5.8.8 2007-08-21
POD_PIPE(1)

Notice that the symbol displayed by cat and the symbol displayed by
perldoc are different.
 
D

Dr.Ruud

jkstill schreef:
Try this. Create a file called pod_pipe.pl with nothing in it
but a pod section:

jkstill-6 > cat pod_pipe.pl
=head1 Does the pipe display correctly?
this is a pipe: |
=cut

Now here is the output from perldoc:
Does the pipe display correctly?
this is a pipe: ?

Also try

$ LANG="" perldoc pod_pipe.pl
 
J

jkstill

jkstill schreef:




Also try

$ LANG="" perldoc pod_pipe.pl

Thank you, that corrected it.

The LANG variable is set to "en_US.UTF-8". Not sure it that is
default, or some app is setting it.

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top