DOKK / manpages / debian 11 / pmtools / pmfunc.1p.en
PMFUNC(1p) User Contributed Perl Documentation PMFUNC(1p)

pmfunc - cat out a function from a module

Given a fully-qualified function, this program opens up the file and attempts to display the source for that function.

    $ pmfunc Cwd::_perl_getcwd
    sub _perl_getcwd
    {
        abs_path('.');
    }

Only subroutines that are defined in the normal fashion are seen, since a simple pattern-match is what does the extraction. Those loaded other ways, such as via AUTOLOAD, typeglob aliasing, or in an "eval", will all necessarily be missed.

This is mostly here for people who are too lazy to type

    sed '/^sub getcwd/,/}/p' `pmpath Cwd`
or
    perl -ne 'print if /^sub\s+getcwd\b/ .. /}/' `pmpath Cwd`

Copyright (C) 1999 Tom Christiansen.

Copyright (C) 2006-2014, 2018 Mark Leighton Fisher.

This is free software; you can redistribute it and/or modify it under the terms of either: (a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or (b) the Perl "Artistic License". (This is the Perl 5 licensing scheme.)

Please note this is a change from the original pmtools-1.00 (still available on CPAN), as pmtools-1.00 were licensed only under the Perl "Artistic License".

2020-07-21 perl v5.30.3