gtrachier has asked for the wisdom of the Perl Monks concerning the following question:

Greetings Perl-ers, I have the following POD at the top of my Perl scripts. For some mysterious reason, the B<...> (and even I<...>) in the NAME section refuse to highlight the enclosed text (foobar). What makes it all the more baffling is that, if "NAME" is changed to anything else, e.g. 'name', 'xNAME', 'NAME1', the following B<> will work! Any suggestions? A POD bug? Thanks for your insights. -GT
#! /usr/bin/perl =head1 NAME B<foobar> -- program to do something =head1 SYNOPSIS B<foobar> [B<--help>] =head1 DESCRIPTION . . .

Replies are listed 'Best First'.
Re: POD - B<> not working as expected
by toolic (Bishop) on Mar 25, 2013 at 17:35 UTC
    I can duplicate your problem on perl 5.14.2 and Pod::Perldoc 3.15_04. Try to use the later version, as daxim suggested. If that doesn't work, try to debug using PERLDOCDEBUG.

    From perl5160delta:

    Pod::Perldoc has been upgraded from version 3.15_03 to 3.17. ... This upgrade has numerous significant fixes. Consult its changelog on the CPAN for more information.
Re: POD - B<> not working as expected
by daxim (Curate) on Mar 25, 2013 at 17:18 UTC
    Works for me with pod2html/Pod::Html 1.09 and 1.1502, perldoc/Pod::Perldoc 3.19_01.
Re: POD - B<> not working as expected
by kcott (Archbishop) on Mar 25, 2013 at 19:21 UTC

    G'day gtrachier,

    Welcome to the monastery.

    A workaround for this involves adding a non-breaking space after NAME:

    =head1 NAMEE<0xa0>

    This fixes both the B<...> and the I<...> issues that you mentioned.

    Note that this doesn't work with a plain space ('NAME') or even with an escaped plain space ('NAMEE<0x20>'). See perlpod for more details on escaped characters.

    My versions:

    $ perl -v This is perl 5, version 14, subversion 2 (v5.14.2) built for darwin-th +read-multi-2level $ perl -E 'use Pod::Perldoc; say $Pod::Perldoc::VERSION' 3.15_04

    -- Ken

Re: POD - B<> not working as expected
by gtrachier (Initiate) on Mar 25, 2013 at 20:06 UTC

    Thanks all for your suggestions. The non-breaking space looks like the best solution for now. I ran the script through podchecker before humbly submitting to the monks' solemn wisdom. It didn't complain in this section of the POD.

    I'm running: This is perl 5, version 12, subversion 4 (v5.12.4) built for darwin-thread-multi-2level

    -GT