Perldoc and the pipe "|" character

Discussion in 'Perl Misc' started by jkstill, Aug 20, 2007.

  1. jkstill

    jkstill Guest

    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?
     
    jkstill, Aug 20, 2007
    #1
    1. Advertising

  2. jkstill

    Larry Guest

    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 │ 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).
     
    Larry, Aug 21, 2007
    #2
    1. Advertising

  3. jkstill

    jkstill Guest

    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 │ 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).


    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.
     
    jkstill, Aug 21, 2007
    #3
  4. jkstill

    Dr.Ruud Guest

    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."
     
    Dr.Ruud, Aug 21, 2007
    #4
  5. jkstill

    jkstill Guest

    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.
     
    jkstill, Aug 22, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. lee, wonsun
    Replies:
    1
    Views:
    505
    Jack Klein
    Nov 2, 2004
  2. Chris McMahon
    Replies:
    2
    Views:
    222
    David Vallner
    Oct 19, 2006
  3. Replies:
    1
    Views:
    248
    Ben Morrow
    Jun 2, 2004
  4. Replies:
    3
    Views:
    117
  5. Miki Tebeka
    Replies:
    0
    Views:
    177
    Miki Tebeka
    Dec 5, 2012
Loading...

Share This Page