Perldoc and the pipe "|" character
Perldoc and the pipe "|" character
am 20.08.2007 22:59:32 von 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 â=82 sort -uâ=82
As you can see those are not pipes - |
What might be the reason for this, and a solution to get the | to
display properly?
Re: Perldoc and the pipe "|" character
am 21.08.2007 19:41:10 von Larry
On Aug 20, 4:59 pm, jkstill wrote:
> 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 â=82 sort -uâ=82
>
> 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).
Re: Perldoc and the pipe "|" character
am 21.08.2007 20:06:29 von jkstill
On Aug 21, 10:41 am, Larry wrote:
> On Aug 20, 4:59 pm, jkstill wrote:
>
>
>
> > 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 â=82 sort -uâ=82
>
> > 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).
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
=3Dhead1 Does the pipe display correctly?
this is a pipe: |
=3Dcut
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: â=82
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.
Re: Perldoc and the pipe "|" character
am 21.08.2007 20:41:16 von rvtol+news
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
--
Affijn, Ruud
"Gewoon is een tijger."
Re: Perldoc and the pipe "|" character
am 22.08.2007 01:54:19 von jkstill
On Aug 21, 11:41 am, "Dr.Ruud" wrote:
> 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
>
> --
> Affijn, Ruud
>
> "Gewoon is een tijger."
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.