App-perlfind

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

    - added heuristic for when the search term contains '::': assume it's a
      module if the final symbol starts with an uppercase character, assume
      it's a fully-qualified function otherwise (thanks RWSTAUNER for the bug
      report)
    - __FILE__, __LINE__ and __PACKAGE__ are found in perlfunc, but __DATA__
      and __END__ are found in perldata
    - __DIE__ and __WARN__ are found in perlvar under '%SIG'
    - can find file test functions like -r, -w, -x etc.
    - searching for predefined variables now works with and without the sigil
      as long as the variable is either a number, the topicalizer or has at
      least two word characters. So 'INPUT_RECORD_SEPARATOR',
      '$INPUT_RECORD_SEPARATOR', 'RS', '$RS' and '$/' all find the same thing.

2.03  2012-03-04 10:34:21 Europe/Vienna
    - complete rewrite; perlfind now based on Pod::Cpandoc and this
      Pod::Perldoc and inherits all of their features. Especially command-line
      switches work like for perldoc.

2.02  2012-03-03 17:02:54 Europe/Vienna
    - show --help if no search term is given

2.01  2012-03-03 16:17:22 Europe/Vienna

README  view on Meta::CPAN

DESCRIPTION

    perlfind is like cpandoc and therefore also like perldoc except it
    knows about more things. Try these:

        perlfind xor
        perlfind foreach
        perlfind isa
        perlfind AUTOLOAD
        perlfind TIEARRAY
        perlfind INPUT_RECORD_SEPARATOR
        perlfind '$^F'
        perlfind '\Q'
        perlfind PERL5OPT
        perlfind :mmap
        perlfind __WARN__
        perlfind __PACKAGE__
        perlfind head4
        perlfind UNITCHECK

    If perlfind doesn't know about a search term, it will delegate the

lib/App/perlfind.pm  view on Meta::CPAN

=head1 DESCRIPTION

C<perlfind> is like C<cpandoc> and therefore also like C<perldoc>
except it knows about more things. Try these:

    perlfind xor
    perlfind foreach
    perlfind isa
    perlfind AUTOLOAD
    perlfind TIEARRAY
    perlfind INPUT_RECORD_SEPARATOR
    perlfind '$^F'
    perlfind '\Q'
    perlfind PERL5OPT
    perlfind :mmap
    perlfind __WARN__
    perlfind __PACKAGE__
    perlfind head4
    perlfind UNITCHECK

If C<perlfind> doesn't know about a search term, it will delegate the

lib/App/perlfind/Plugin/Perlvar.pm  view on Meta::CPAN

# the query key gets rewritten as.

# TODO generate this hash at runtime just like perlvar-extract does.
# Needs to find perlvar.pod; at the moment I use "perldoc -l perlvar"
# for that, but it seems bad to call perldoc more or less within
# itself. Pod::Perldoc doesn't provide a method just to find the POD
# file, though.

my %is_var = (
            '%+' => '%+',
            'INPUT_LINE_NUMBER' => '$INPUT_LINE_NUMBER',
            '$ERRNO' => '$ERRNO',
            '$OSNAME' => '$OSNAME',
            '$b' => '$b',
            'ERRNO' => '%ERRNO',
            'SIG' => '%SIG',
            '$OUTPUT_FIELD_SEPARATOR' => '$OUTPUT_FIELD_SEPARATOR',
            '@_' => '@_',
            'UNICODE' => '${^UNICODE}',
            'LAST_SUBMATCH_RESULT' => '$LAST_SUBMATCH_RESULT',
            '$COMPILING' => '$COMPILING',
            '%ERRNO' => '%ERRNO',
            '$OUTPUT_RECORD_SEPARATOR' => '$OUTPUT_RECORD_SEPARATOR',
            '$FORMAT_NAME' => '$FORMAT_NAME',
            '${^RE_DEBUG_FLAGS}' => '${^RE_DEBUG_FLAGS}',
            '$EUID' => '$EUID',
            'OPEN' => '${^OPEN}',
            'EXECUTABLE_NAME' => '$EXECUTABLE_NAME',
            'EFFECTIVE_USER_ID' => '$EFFECTIVE_USER_ID',
            '$OS_ERROR' => '$OS_ERROR',
            'CHILD_ERROR_NATIVE' => '$^CHILD_ERROR_NATIVE',
            'ENCODING' => '${^ENCODING}',
            '$`' => '$`',

lib/App/perlfind/Plugin/Perlvar.pm  view on Meta::CPAN

            '$+' => '$+',
            '$RS' => '$RS',
            'UID' => '$UID',
            '@LAST_MATCH_START' => '@LAST_MATCH_START',
            'FORMAT_LINES_LEFT' => '$FORMAT_LINES_LEFT',
            'PERL_VERSION' => '$PERL_VERSION',
            '$/' => '$/',
            '2' => '$2',
            '$LAST_SUBMATCH_RESULT' => '$LAST_SUBMATCH_RESULT',
            'NR' => '$NR',
            'OUTPUT_FIELD_SEPARATOR' => '$OUTPUT_FIELD_SEPARATOR',
            '${^RE_TRIE_MAXBUF}' => '${^RE_TRIE_MAXBUF}',
            '$0' => '$0',
            'RE_TRIE_MAXBUF' => '${^RE_TRIE_MAXBUF}',
            '$^X' => '$^X',
            'OFS' => '$OFS',
            '$WARNING' => '$WARNING',
            'FORMAT_NAME' => '$FORMAT_NAME',
            '$=' => '$=',
            'ARGV' => '@ARGV',
            'INC' => '%INC',

lib/App/perlfind/Plugin/Perlvar.pm  view on Meta::CPAN

            '$$' => '$$',
            '$FORMAT_TOP_NAME' => '$FORMAT_TOP_NAME',
            '$^V' => '$^V',
            '$EVAL_ERROR' => '$EVAL_ERROR',
            '$-' => '$-',
            '$ACCUMULATOR' => '$ACCUMULATOR',
            '$^I' => '$^I',
            '$^R' => '$^R',
            '%ENV' => '%ENV',
            '$&' => '$&',
            'OUTPUT_RECORD_SEPARATOR' => '$OUTPUT_RECORD_SEPARATOR',
            'ARRAY_BASE' => '$ARRAY_BASE',
            'EXCEPTIONS_BEING_CAUGHT' => '$EXCEPTIONS_BEING_CAUGHT',
            '$]' => '$]',
            '$LAST_PAREN_MATCH' => '$LAST_PAREN_MATCH',
            'PROGRAM_NAME' => '$PROGRAM_NAME',
            '$BASETIME' => '$BASETIME',
            '0' => '$0',
            '$UID' => '$UID',
            '${^WIN32_SLOPPY_STAT}' => '${^WIN32_SLOPPY_STAT}',
            '$^P' => '$^P',

lib/App/perlfind/Plugin/Perlvar.pm  view on Meta::CPAN

            'SUBSEP' => '$SUBSEP',
            '7' => '$7',
            '$EXTENDED_OS_ERROR' => '$EXTENDED_OS_ERROR',
            '${^MATCH}' => '${^MATCH}',
            '$PREMATCH' => '$PREMATCH',
            '$OFMT' => '$OFMT',
            'GID' => '$GID',
            '$a' => '$a',
            '$*' => '$*',
            '$PID' => '$PID',
            'OUTPUT_AUTOFLUSH' => '$OUTPUT_AUTOFLUSH',
            'PREMATCH' => '$PREMATCH',
            '%LAST_PAREN_MATCH' => '%LAST_PAREN_MATCH',
            '$FORMAT_LINES_LEFT' => '$FORMAT_LINES_LEFT',
            'GLOBAL_PHASE' => '${^GLOBAL_PHASE}',
            '$EXECUTABLE_NAME' => '$EXECUTABLE_NAME',
            '$POSTMATCH' => '$POSTMATCH',
            'INPUT_RECORD_SEPARATOR' => '$INPUT_RECORD_SEPARATOR',
            '${^UNICODE}' => '${^UNICODE}',
            '$^CHILD_ERROR_NATIVE' => '$^CHILD_ERROR_NATIVE',
            'FORMAT_LINES_PER_PAGE' => '$FORMAT_LINES_PER_PAGE',
            'OFMT' => '$OFMT',
            '$FORMAT_LINES_PER_PAGE' => '$FORMAT_LINES_PER_PAGE',
            'FORMAT_TOP_NAME' => '$FORMAT_TOP_NAME',
            '$EGID' => '$EGID',
            '$OUTPUT_AUTOFLUSH' => '$OUTPUT_AUTOFLUSH',
            '$3' => '$3',
            '$REAL_GROUP_ID' => '$REAL_GROUP_ID',
            '$;' => '$;',
            '$^L' => '$^L',
            'OLD_PERL_VERSION' => '$OLD_PERL_VERSION',
            '$SYSTEM_FD_MAX' => '$SYSTEM_FD_MAX',
            'POSTMATCH' => '${^POSTMATCH}',
            '$INPUT_LINE_NUMBER' => '$INPUT_LINE_NUMBER',
            '_' => '$_',
            '@LAST_MATCH_END' => '@LAST_MATCH_END',
            '$^S' => '$^S',
            '$LAST_REGEXP_CODE_RESULT' => '$LAST_REGEXP_CODE_RESULT',
            '${^OPEN}' => '${^OPEN}',
            '$1' => '$1',
            '@-' => '@-',
            'EFFECTIVE_GROUP_ID' => '$EFFECTIVE_GROUP_ID',
            '$|' => '$|',
            '%OS_ERROR' => '%OS_ERROR',

lib/App/perlfind/Plugin/Perlvar.pm  view on Meta::CPAN

            'WARNING_BITS' => '${^WARNING_BITS}',
            '$(' => '$(',
            '$#' => '$#',
            '$@' => '$@',
            'EXTENDED_OS_ERROR' => '$EXTENDED_OS_ERROR',
            'CHILD_ERROR' => '$CHILD_ERROR',
            'EUID' => '$EUID',
            '$,' => '$,',
            'ENV' => '%ENV',
            '$DEBUGGING' => '$DEBUGGING',
            '$INPUT_RECORD_SEPARATOR' => '$INPUT_RECORD_SEPARATOR',
            '$?' => '$?',
            '$REAL_USER_ID' => '$REAL_USER_ID',
            '$NR' => '$NR',
            '$^M' => '$^M',
            '${^TAINT}' => '${^TAINT}',
            'REAL_GROUP_ID' => '$REAL_GROUP_ID',
            '@ARGV' => '@ARGV',
            'LAST_REGEXP_CODE_RESULT' => '$LAST_REGEXP_CODE_RESULT',
            'UTF8CACHE' => '${^UTF8CACHE}',
            'FORMAT_FORMFEED' => '$FORMAT_FORMFEED',

lib/App/perlfind/Plugin/Perlvar.pm  view on Meta::CPAN

    # perlfind SIG
    # perlfind QUIT
    # perlfind __WARN__
    # perlfind WARN

=head1 DESCRIPTION

This plugin for L<App::perlfind> knows where to find documentation for
predefined variables and signals. It knows about things like

    OUTPUT_RECORD_SEPARATOR
    $^R
    __WARN__
    WARN
    QUIT

t/find_matches.t  view on Meta::CPAN

use Test::Differences;
use App::perlfind;
my %expect = (

    # The first element of the value is what the query gets rewritten as.
    'xor'                    => [ 'xor'                     => qw(perlop) ],
    'foreach'                => [ 'foreach'                 => qw(perlsyn) ],
    'isa'                    => [ 'isa'                     => qw(perlobj) ],
    'TIEARRAY'               => [ 'TIEARRAY'                => qw(perltie) ],
    'AUTOLOAD'               => [ 'AUTOLOAD'                => qw(perlsub) ],
    'INPUT_RECORD_SEPARATOR' => [ '$INPUT_RECORD_SEPARATOR' => qw(perlvar) ],
    '$RS'                    => [ '$RS'                     => qw(perlvar) ],
    '$/'                     => [ '$/'                      => qw(perlvar) ],
    '$^F'                    => [ '$^F'                     => qw(perlvar) ],
    'PERL5OPT'               => [ 'PERL5OPT'                => qw(perlrun) ],
    ':mmap'                  => [ ':mmap'                   => qw(PerlIO) ],
    '__WARN__'               => [ '%SIG'                    => qw(perlvar) ],
    '__PACKAGE__'                 => [ '__PACKAGE__'   => qw(perlfunc perlop) ],
    'head4'                       => [ 'head4'         => qw(perlpod) ],
    '=head4'                      => [ '=head4'        => qw(perlpod) ],
    'App::perlfind'               => [ 'App::perlfind' => qw(App::perlfind) ],



( run in 0.360 second using v1.01-cache-2.11-cpan-4e96b696675 )