in reply to Re: perldoc -lf anomaly
in thread perldoc -lf anomaly

returns perlfunc and perlop regardless of what "whatever" is.

$ perldoc -lf anomaly
/home/choroba/localperl/lib/5.43.9/pod/perlfunc.pod
/home/choroba/localperl/lib/5.43.9/pod/perlop.pod

Thanks for looking into it choroba. These results clearly contradict the perldoc documentation:

perldoc perldoc (and man perldoc) says:
-l   Display only the file name of the module found.

perldoc --help says:
-l   Display the module's file name
Here's another anomaly:
% perldoc -lf splice    
/Users/u/perl5/perlbrew/perls/perl-5.42.0/lib/5.42.0/pods/perlfunc.pod
/Users/u/perl5/perlbrew/perls/perl-5.42.0/lib/5.42.0/pods/perlop.pod

% perldoc $_        
No documentation found for "splice".

% perldoc -v $_
'splice' does not look like a Perl variable

% perldoc -v '$_'
$_      The default input and pattern-searching space...
And another one:
% perldoc -v '$_'
$_      The default input and pattern-searching space...

% perldoc -v '@_' 
@_      Within a subroutine the array @_ contains the parameters...

% perldoc -v '%_'
No documentation for perl variable '%_' found

Replies are listed 'Best First'.
Re^3: perldoc -lf anomaly
by choroba (Cardinal) on May 07, 2026 at 22:13 UTC
    I'm not sure about the "another anomaly". You get the documentation of splice for $_, as $_ without quotes is the shell variable which contains the last argument of the last command.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Re^3: perldoc -lf anomaly
by ikegami (Patriarch) on May 08, 2026 at 06:09 UTC

    These results clearly contradict the perldoc documentation:

    That's not true. The docs don't say what happens if you use -l with -f func instead of a module.

    Here's another anomaly

    What do you think is anomalous? That it's looking up splice instead of $_? That's your error. You interpolated shell variable $_ into your shell command, and it apparently had the value splice.

    And another one:

    What do you think is anomalous? That output is correct too, and I have no idea what you think is wrong.

Re^3: perldoc -lf anomaly
by ikegami (Patriarch) on May 08, 2026 at 06:14 UTC

    These results clearly contradict the perldoc documentation:

    That's not true. The docs don't say what happens if you use -l with -f func instead of a module.

    Here's another anomaly

    What do you think is anomalous? That it's looking up splice instead of $_? That's your error. You interpolated shell variable $_ into your shell command, and it apparently had the value splice.

    And another one:

    What do you think is anomalous? That output is correct too, and I have no idea what you think is wrong.