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

Dear Monks,

perldoc -lf grep returns perlfunc.pod and perlop.pod, but perldoc -f grep only shows results from perlfunc.pod. Why does -l list 2 files but -f only uses 1?

Thank you.

Replies are listed 'Best First'.
Re: What is perldoc -lf doing?
by LanX (Saint) on Aug 03, 2018 at 03:21 UTC
    perldoc -f NAME always lists results found in perlfunc.pod and perlop.pod.

    That's what -l is telling you, for every possible NAME.

    The builtin function grep is finally only found in perlfunc , but operators like == only in perlop .

    D:\Users\lanx>perldoc -lf == C:\Perl_64\lib\pods\perlfunc.pod C:\Perl_64\lib\pods\perlop.pod D:\Users\lanx>perldoc -f == Equality Operators Binary "==" returns true if the left argument is numerically equal + to the right argument. ...

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      What am I missing with my install?

      $ perldoc -f == No documentation for perl function '==' found $ sudo apt-get install perl-doc [sudo] password for bob: Reading package lists... Done Building dependency tree Reading state information... Done perl-doc is already the newest version (5.26.1-6ubuntu0.2). 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. $
        It's probably MSWin specific. It doesn't work for me either, not even in blead:
        $ perldoc -f == No documentation for perl function '==' found

        ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
        Probably a glitch on console level.(?)

        I used Windows and you Linux and bash tries to use == for its own syntax.(untested)

        ( You know Perl was built for UNIX ... Ehm wait... ;)

        update

        Nope: works with Ubuntu and Perl 5.18, so probably a bug with newer Perl versions.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Re: What is perldoc -lf doing?
by Anonymous Monk on Aug 07, 2018 at 22:29 UTC
    Let's find the bug in Pod::Perldoc! I've been reading the source and nothing seems amiss yet, but there is some TODO and notes about an "insane" subroutine. Here are some results:

    This one works:
    perldoc -f ?


    But these get weird and weirder:
    perldoc -f ??
    perldoc -f ???
    perldoc -f ????


    This works too:
    perldoc -f '<'
    perldoc -f '<<'


    But not this:
    perldoc -f '>'
    perldoc -f '>>'


    Quotemeta and \Q \E are in play but this smells like a quoting bug to me. Good luck! :-)