perldoc -l for modules without pod

perldoc -l Carton prints the path to Carton.pm so I can write

vim $(perldoc -l Carton)

if I want to open it in vim.

perldoc -l Carton::CLI print
No documentation found for "Carton::CLI".

even though there is a Carton::CLI module

wouldn't it be nice it also printed the path to the module, even if it did not have pod in it?

Alternatively, can you recommend another way to access the source code of an installed module?

4 Comments

mpath from Module::Path does the trick quite nicely. See also http://blogs.perl.org/users/neilb/2014/01/whats-your-tiny-tip.html

Have you tried perldoc -lm?

indeed I have a bash alias to "vim `perldoc -lm $*`" for convenient viewing and editing of installed code ;)

Leave a comment

About Gabor Szabo

user-pic Perl author and trainer. Usually writing on other sites: Writing the Perl Maven tutorial Perl 6 articles. Started a Perl IDE. Running the Weekly Perl newsletter. My personal blog.