in reply to Perl One Liner to Check Location of a Module

$ perldoc -l Foo::Bar

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Replies are listed 'Best First'.
Re^2: Perl One Liner to Check Location of a Module
by philcrow (Priest) on Apr 09, 2007 at 13:54 UTC
    Yes. We use this in a shell function defined in .bashrc:
    viperl() { vi `perldoc -l $1 | sed -e 's/pod$/pm/'` }
    which begins a vi session on the module in question so you can see if it has the code you thought it did.

    Phil

Re^2: Perl One Liner to Check Location of a Module
by merlyn (Sage) on Apr 09, 2007 at 17:30 UTC
    If the module has both a .pod and a .pm, an undocumented trick is to say: perldoc -lm Foo::Bar and you get the .pm and not the .pod.

      I don't think it needs the -l in that case.

      perldoc -m Foo::Bar

      -xdg

      Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.