| 1 | package pmtools; | ||||||||||||||
| 2 | |||||||||||||||
| 3 | 4 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | 4 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | |||||||||||||||
| 6 | 4 | our $VERSION = '2.2.0'; | |||||||||||||
| 7 | |||||||||||||||
| 8 | 3 | ▶ | sub new_pod_iterator { | ||||||||||||
|
Subroutine
new_pod_iterator: called CC=1 SCAR=1.2
Pod
undocumented
| |||||||||||||||
| 9 | 0 | ▶ | my ($module) = @_; # module name | ||||||||||||
|
Subroutine
new_pod_iterator: not called CC=1 SCAR=1.2
Pod
undocumented
| |||||||||||||||
| 10 | |||||||||||||||
| 11 | 0 | my $index = 0; # index of all possible POD files | |||||||||||||
| 12 | 0 | my $inc_index = 0; # index into @INC | |||||||||||||
| 13 | 0 | my $pod_index = 0; # index into @pods | |||||||||||||
| 14 | 0 | my @pods = ( # list of possible POD files given an @INC directory | |||||||||||||
| 15 | "pod/$module.pod", | ||||||||||||||
| 16 | "$module.pod", | ||||||||||||||
| 17 | "$module.pm", | ||||||||||||||
| 18 | ); | ||||||||||||||
| 19 | |||||||||||||||
| 20 | 68 | ▶ | return sub { | ||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=9.2
| |||||||||||||||
| 21 | 0 | ▶ | if ($index >= scalar @INC * scalar @pods) { | ||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=9.2
Branch: 2 branches
| |||||||||||||||
| 22 | 0 | return undef; | |||||||||||||
| 23 | } | ||||||||||||||
| 24 | |||||||||||||||
| 25 | 0 | $inc_index = $index / scalar @pods; | |||||||||||||
| 26 | 0 | $pod_index = $index % scalar @pods; | |||||||||||||
| 27 | 0 | $index++; | |||||||||||||
| 28 | |||||||||||||||
| 29 | 0 | return "$INC[$inc_index]/$pods[$pod_index]"; | |||||||||||||
| 30 | 0 | }; | |||||||||||||
| 31 | } | ||||||||||||||
| 32 | |||||||||||||||
| 33 | 4 | 1; | |||||||||||||
| 34 | |||||||||||||||
| 35 | |||||||||||||||
| 36 | # ------ From Tom Christiansen's original README file for pmtools: | ||||||||||||||
| 37 | # This is pmtools -- a suite of small programs to help manage modules. | ||||||||||||||
| 38 | # The names are totally preliminary, and in fact, so is the code. We follow | ||||||||||||||
| 39 | # the "keep it small" notion of many tiny tools each doing one thing well, | ||||||||||||||
| 40 | # eschewing giant megatools with millions of options. | ||||||||||||||
| 41 | # | ||||||||||||||
| 42 | # Tom Christiansen | ||||||||||||||
| 43 | # tchrist@perl.com | ||||||||||||||
| 44 | |||||||||||||||
| 45 | =head1 NAME | ||||||||||||||
| 46 | |||||||||||||||
| 47 | pmtools - Perl Module Tools | ||||||||||||||
| 48 | |||||||||||||||
| 49 | =head1 SYNOPSIS | ||||||||||||||
| 50 | |||||||||||||||
| 51 | pmdesc module ... | ||||||||||||||
| 52 | pmpath module ... | ||||||||||||||
| 53 | pmvers module ... | ||||||||||||||
| 54 | ... | ||||||||||||||
| 55 | sitepods | ||||||||||||||
| 56 | ... | ||||||||||||||
| 57 | |||||||||||||||
| 58 | =head1 DESCRIPTION | ||||||||||||||
| 59 | |||||||||||||||
| 60 | Perl Modules Tools (pmtools) is a suite of tools designed | ||||||||||||||
| 61 | originally by Tom Christiansen. | ||||||||||||||
| 62 | |||||||||||||||
| 63 | For each module name given as an argument, produces its full path on | ||||||||||||||
| 64 | the standard output, one per line. | ||||||||||||||
| 65 | |||||||||||||||
| 66 | =head1 EXAMPLES | ||||||||||||||
| 67 | |||||||||||||||
| 68 | $ pmpath CGI | ||||||||||||||
| 69 | /usr/local/devperl/lib/5.00554/CGI.pm | ||||||||||||||
| 70 | |||||||||||||||
| 71 | $ filsperl -S pmpath IO::Socket CGI::Carp | ||||||||||||||
| 72 | /usr/local/filsperl/lib/5.00554/i686-linux-thread/IO/Socket.pm | ||||||||||||||
| 73 | /usr/local/filsperl/lib/5.00554/CGI/Carp.pm | ||||||||||||||
| 74 | |||||||||||||||
| 75 | $ oldperl -S pmpath CGI CGI::Imagemap | ||||||||||||||
| 76 | /usr/lib/perl5/CGI.pm | ||||||||||||||
| 77 | /usr/lib/perl5/site_perl/CGI/Imagemap.pm | ||||||||||||||
| 78 | |||||||||||||||
| 79 | =head1 SEE ALSO | ||||||||||||||
| 80 | |||||||||||||||
| 81 | pmdesc(1), | ||||||||||||||
| 82 | pmvers(1), | ||||||||||||||
| 83 | pmcat(1). | ||||||||||||||
| 84 | |||||||||||||||
| 85 | =head1 AUTHORS and COPYRIGHTS | ||||||||||||||
| 86 | |||||||||||||||
| 87 | Copyright (C) 1999 Tom Christiansen. | ||||||||||||||
| 88 | |||||||||||||||
| 89 | Copyright (C) 2006-2014, 2018 Mark Leighton Fisher. | ||||||||||||||
| 90 | |||||||||||||||
| 91 | =head1 LICENSE | ||||||||||||||
| 92 | |||||||||||||||
| 93 | This is free software; you can redistribute it and/or modify it | ||||||||||||||
| 94 | under the terms of either: | ||||||||||||||
| 95 | (a) the GNU General Public License as published by the Free | ||||||||||||||
| 96 | Software Foundation; either version 1, or (at your option) any | ||||||||||||||
| 97 | later version, or | ||||||||||||||
| 98 | (b) the Perl "Artistic License". | ||||||||||||||
| 99 | (This is the Perl 5 licensing scheme.) | ||||||||||||||
| 100 | |||||||||||||||
| 101 | Please note this is a change from the | ||||||||||||||
| 102 | original pmtools-1.00 (still available on CPAN), | ||||||||||||||
| 103 | as pmtools-1.00 were licensed only under the | ||||||||||||||
| 104 | Perl "Artistic License". | ||||||||||||||