http://qs321.pair.com?node_id=11100871


in reply to cpan installing .3pm files?

Even without knowing that .3pm indicates a man page, there's a pretty strong clue in that the full path of the file includes a .../man/... directory.

As for why your code couldn't find the file to (try to) use it, note that the filename is Search::Elasticsearch.3pm, but the error message indicates that Perl was trying to find a module named Search/Elasticsearch.pm - use converts :: to /, while the filename contains a literal ::, in addition to the extension being different.

Of course, if you really wanted to, you could pass the filename as a string (rather than a bareword) to require and get Perl to try to load it as a module that way, despite the literal colons and the extension... but it would still fail, because the file content is written in troff markup rather than Perl code and/or POD markup, so the result would be an ugly mess of syntax errors instead of working code:

~$ perl -E "require '/usr/local/share/man/man3/oo.3pm'" Bareword found where operator expected at /usr/local/share/man/man3/oo +.3pm line 2, near "*(C" (Missing operator before C?) String found where operator expected at /usr/local/share/man/man3/oo.3 +pm line 4, near ". ds C` "" (Missing semicolon on previous line?) String found where operator expected at /usr/local/share/man/man3/oo.3 +pm line 5, near ". ds C' "" (Missing semicolon on previous line?) String found where operator expected at /usr/local/share/man/man3/oo.3 +pm line 6, near ". ds L"" (Missing semicolon on previous line?) <...a few dozen more lines of the same omitted...> String found where operator expected at /usr/local/share/man/man3/oo.3 +pm line 22, at end of line (Missing semicolon on previous line?) Can't find string terminator '"' anywhere before EOF at /usr/local/sha +re/man/man3/oo.3pm line 22. Compilation failed in require at -e line 1.