pmtools-1.54000755001750001750 012230550312 20066 5ustar00markleightonfishermarkleightonfisher000000000000TODO100755001750001750 112512230550312 20641 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54In no particular order, here are some of my goals for pmtools: * Fix plxload, which does not work for me under Cygwin. * Investigate CPAN module manipulation packages for use in additional pmtools. * Add the "pmtools" command sent me by Matthew Persico. * Fix podgrep -i so it actually works again. * Fix pmfunc so it actually works again. * Add tests for modules. * Remove Makefile.lame. * Add support for running the programs under Windows. Probably want to wrap them in batch files for maximum portability. * Add tests for the modules. * Solicit other ideas from Perl community members. README100644001750001750 43512230550312 21011 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54 This archive contains the distribution pmtools, version 1.54: Perl Module Tools This software is copyright (c) 2013 by Mark Leighton Fisher. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Changes100755001750001750 1322612230550312 21471 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54v1.54 2013-10-19 14:21:26 EST Mark Leighton Fisher - Updated $VERSION in the modules and documented it too :)! v1.53 2013-10-18 17:31:35 EST Mark Leighton Fisher - Tried to update $VERSION in the modules. v1.52 2013-09-28 19:00:47 EST Mark Leighton Fisher - Updated $VERSION in the modules. v1.51 2013-09-27 06:19:01 EST Mark Leighton Fisher - NOTE: These are all fixes in the tests. - Fixed rt.cpan.org 88843, "t/pmall.t takes a long time" by using a head(1) clone (t/head.pl) to grab just the first 100 lines of pmall output, then matching against the general form of pmall output rather than specifically looking for Scalar::Util. - Fixed the tests to use Tie::Hash (pure Perl) instead of Scalar::Util, as there may or may not be a ...Scalar/Util.pm depending on how Perl was packaged and installed (Scalar::Util can exist as a pure Perl module and (more powerfully) as a mix of Perl and XS). - Fixed t/pmfunc.t and t/pmcheck.t to just check $? != 127 (i.e. the program ran in some way) rather than looking for a specific exit code. pmfunc does not work again yet, and pmcheck may or may not return an error depending whether your Perl configuration is correct. - Fixed t/pman.t, t/pmcat.t, and t/pmdesc.t to use the Carp module because Carp always has POD (Tie::Hash may not depending on the Perl version, and see above for Scalar::Util problems). v1.50 2013-09-20 17:00:33 EST Mark Leighton Fisher - This is the "Testing" release of pmtools! All of the pmtools now have tests. - Fixed so all programs and modules use a fixed value (literal) for $VERSION. This seems to work better with the CPAN toolchain. As I also updated all of the version numbers, this will fix rt.cpan.org "#88534: pmtools 1.40: Still has "1.30" in pmtools.pm" - Fixed so all tests add the pmtools to the PATH, whether or not the test actually needs it. This should fix rt.cpan.org "#88780: test failure". - Fixed pfcat documentation to always refer to "pfcat". - Fixed rt.cpan.org "#85352: typo fixes". v1.40 2013-09-04 16:53:36 EST Mark Leighton Fisher - This is the "Kwalitee" release of pmtools! All of the Test::Kwalitee and Test::Kwalitee::Extra tests now pass. - I have (briefly) tested this release on Debian 7.1 with Perl 5.8.8, 5.14.2, and 5.18.1. - Please note that there are currently only tests for basepods and faqpods. My current plan is add tests for all other programs and modules in the next release. - This is the first release where I used Dist::Zilla to create the release. A special thanks to David Golden for bundling some many useful Dist::Zilla plugins together (Dist::Zilla::PluginBundle::DAGOLDEN). - All programs and modules now 'use strict' and 'use warnings' (part of "Kwalitee"). - Licensing information is now in the LICENSE section for programs and modules (part of "Kwalitee'). - There are now LICENSE, MYMETA.json, META.yml, and MYMETA.yml files (part of "Kwalitee"). - Programs are now in the standard location 'bin'. - Devel::Loaded is now in the standard location lib/Devel/Loaded.pm. - There is now a 'pmtools' module (lib/pmtools.pm). - 'pmtools' is now the source of the version number for all other programs and modules in pmtools. This should satisfy dsteinbrunner's pull request of April 27, 2013. - 'pminclude' lists the directories in @INC. This replaces the poorly-named 'pmdirs' program. - Documentation for Devel::Loaded has been fixed. This should satisfy neilbowers' pull request of December 21, 2012 and neilbowers' pull request of July 16, 2013. - I've fixed some permissions and such that should satisfy dolmen's pull request of December 25, 2012. - INTERNAL DETAIL: This version was developed on a separate branch rather than 'master' (some Git goodness). v1.30 2013-01-18 17:24:19 EST Mark Leighton Fisher - Moved to Git for source control. - Added the GitHub repo https://github.com/markleightonfisher/pmtools. - Fixed Devel/Loaded.pm so it is not added to the output. Thanks to NEILB@cpan.org for spotting this bug (a modern Perls bug). - Patched pmeth to flag Perl constants as such (thanks to jpierce@cpan.org for the patch). XS constants are not yet marked (some C-fu needs to be applied). - Patched basepods to use 'pods' as the directory for the base PODs (modern Perls use 'pods'). Alas, this appears to be inspired by a CPANgnome, as there was no Requestor on the ticket. :( v1.20 2012-12-07 15:25:50 EST Mark Leighton Fisher - Patched pminst so only unique package names are printed. Thanks to Matthew Persico for the patch. (Honorable mention goes to Andrew Pam, but Matthew's patch is smaller and more robust as it handles an @INC with directories in any order.) - Fixed pminst to ignore non-existent directories. - Added pmcheck, a tool to check that Perl is set up correctly for use with Perl modules. Currently, pmcheck only verifies that everything in @INC is an existing, readable directory. v1.10 2008-01-18 06:57:21 EST Mark Leighton Fisher - Added copyrights in my name as well as Tom Christiansen. - Changed to dual-license like Perl: GNU and Perl Artistic. This was at the request of the Fedora project, as they wanted a version of pmtools licensed under GNU. v1.01 2006-03-21 21:33:52 EST Mark Leighton Fisher - Two sets of patches from Jose Pedro Oliveira: 1. Added missing pmeth to Makefile.PL. 2. "$mod" was partially renamed to "$module" in my copy; this patch restores it to "$mod". - Added Changes and TODO files. - Updated MANIFEST with Changes and TODO. LICENSE100644001750001750 4370312230550312 21203 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54This software is copyright (c) 2013 by Mark Leighton Fisher. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself 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 "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2013 by Mark Leighton Fisher. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2013 by Mark Leighton Fisher. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End bin000755001750001750 012230550312 20557 5ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54pman100755001750001750 334012230550312 21600 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # pman -- show a module's man page # ------ pragmas use strict; use warnings; our $VERSION = '1.50'; # ------ define variables my $errors = 0; # error count my $module = undef; # module name my $pager = undef; # $ENV{PAGER} - pager program my $path = undef; # path for pod2text BEGIN { $^W = 1 } BEGIN { die "usage: $0 module ...\n" unless @ARGV } use FindBin qw($Bin); $errors = 0; unless ($pager = $ENV{PAGER}) { require Config; $pager = $Config::Config{"pager"} || "more"; } for $module (@ARGV) { my $path = `$Bin/pmpath $module`; if ($?) { $errors++; next; } chomp $path; system "pod2text $path | $pager"; $errors += ($? != 1); } exit($errors != 0); __END__ =head1 NAME pman - show a module's man page =head1 DESCRIPTION Send a module's pod through pod2text and your pager. This is mostly here for people too lazy to type $ pod2text `pmpath CGI` | $PAGER =head1 EXAMPLES $ pman CGI $ pman Curses Or running under different versions of Perl: $ oldperl -S pman CGI $ filsperl -S pman Threads =head1 SEE ALSO pod2text(1), perlpod(1), pod2man(1), pod2html(1). =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". pmls100755001750001750 254112230550312 21622 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # pmls -- show date stamp of module # ------ pragmas use strict; use warnings; our $VERSION = '1.50'; BEGIN { $^W = 1 } # ------ define variable my $module = undef; # module name use FindBin qw($Bin); unless (@ARGV) { die "usage: $0 module ...\n"; } for $module (@ARGV) { system "ls -l " . `$^X -S $Bin/pmpath $module`; } __END__ =head1 NAME pmls - long list the module path =head1 DESCRIPTION This is mostly here for people too lazy to type $ ls -l `pmpath CGI` =head1 EXAMPLES $ pmls CGI -r--r--r-- 1 root root 190901 Dec 6 03:19 /usr/local/devperl/lib/5.00554/CGI.pm $ oldperl -S pmls CGI -r--r--r-- 1 root root 186637 Sep 10 00:18 /usr/lib/perl5/CGI.pm =head1 SEE ALSO pmpath(1) =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". pods100755001750001750 213112230550312 21607 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # pods - print out all pod paths # # this is a perl program not a shell script # so that we can use the correct perl use strict; use warnings; our $VERSION = '1.50'; system $^X, "-S", "stdpods"; system $^X, "-S", "pminst", "-l"; __END__ =head1 NAME pods - print out all pod paths =head1 DESCRIPTION This program is a front end to print out the paths of all the standard podpages and the modules. =head1 SEE ALSO faqpods(1), modpods(1), sitepods(1), podpath(1), pminst(1), and stdpod(1). =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". dist.ini100644001750001750 1157312230550312 21642 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54name = pmtools author = Mark Leighton Fisher license = Perl_5 copyright_holder = Mark Leighton Fisher copyright_year = 2013 [Prereqs] perl = 5.008008 ; version provider [Git::NextVersion] ; get version from last release tag version_regexp = ^release-(.+)$ ; collect (newer) contributors list from Git [ContributorsFromGit] ; choose files to include [Git::GatherDir] ; everything from git ls-files exclude_filename = MANIFEST ; skip this generated file exclude_filename = Makefile.PL ; skip this generated file exclude_filename = README ; skip this generated file exclude_filename = README.pod ; skip this generated file exclude_filename = META.json ; skip this generated file [PruneCruft] [Manifest] [ManifestSkip] [MetaYAML] [License] [Readme] [ExecDir] [ShareDir] [MakeMaker] ;[TestRelease] ;[ExtraTests] ;[ConfirmRelease] ;[UploadToCPAN] ; ------------ ; ------------ old version of dist.ini STARTS HERE ; ------------ ;; ------ ;; ------ derived from DAGOLDEN's bundle: ;; ------ ; ;; version provider ;[Git::NextVersion] ; get version from last release tag ;version_regexp = ^release-(.+)$ ; ;; collect contributors list ;[ContributorsFromGit] ; ;; choose files to include ;[Git::GatherDir] ; everything from git ls-files ;exclude_filename = README.pod ; skip this generated file ;exclude_filename = META.json ; skip this generated file ; ;[PruneCruft] ; default stuff to skip ;;[ManifestSkip] ; if -f MANIFEST.SKIP, skip those, too ; ;; file modifications ;[OurPkgVersion] ; add $VERSION = ... to all files ;[InsertCopyright] ; add copyright at "# COPYRIGHT" ; ;[PodWeaver] ; generate Pod ;config_plugin = @DAGOLDEN ; my own plugin allows Pod::WikiDoc ;finder = :InstallModules ;finder = :ExecFiles ; ;; generated files ;[License] ; boilerplate license ;[ReadmeAnyFromPod] ; from Pod (runs after PodWeaver) ;[ReadmeAnyFromPod / ReadmeInRoo ] ; create README.pod in repo directory ;type = pod ;filename = README.pod ;location = root ; ;;TODO tests for pmtools ;;; t tests ;;[Test::Compile] ; make sure .pm files all compile ;;fake_home = 1 ; fakes $ENV{HOME} just in case ; ;;[Test::MinimumPerl] ;;max_target_perl = 5.010 ; ;;[Test::ReportPrereqs] ; show prereqs in automated test output ; ;;; xt tests ;;[Test::PodSpelling] ; xt/author/pod-spell.t ;;[Test::Perl::Critic]; xt/author/critic.t ;;[MetaTests] ; xt/release/meta-yaml.t ;;[PodSyntaxTests] ; xt/release/pod-syntax.t ;;[PodCoverageTests] ; xt/release/pod-coverage.t ;;[Test::Portability] ; xt/release/portability.t (of file name) ;;options = test_one_dot = 0 ;;[Test::Version] ; xt/release/test-version.t ; ;; metadata ;[AutoPrereqs] ; find prereqs from code ;skip = ^t::lib ; ;;[Prereq] ;;Devel::Loaded = 1.40 ; ;[MinimumPerl] ; determine minimum perl version ; ;[MetaNoIndex] ; sets 'no_index' in META ;directory = t ;directory = xt ;directory = examples ;directory = corpus ;package = DB ; just in case ; ;[AutoMetaResources] ; set META resources ;bugtracker.rt = 1 ;repository.github = user:markleightonfisher ;homepage = https://metacpan.org/release/%{dist} ; ;[MetaProvides::Package] ; add 'provides' to META files ;meta_noindex = 1 ; respect prior no_index directives ; ;[MetaYAML] ; generate META.yml (v1.4) ;[MetaJSON] ; generate META.json (v2) ; ;; build system ;[ExecDir] ; include 'bin/*' as executables ;[ShareDir] ; include 'share/' for File::ShareDir ;[MakeMaker] ; create Makefile.PL ; ;; manifest (after all generated files) ;;[Manifest] ; create MANIFEST ; ;; copy META.json back to repo dis ;[CopyFilesFromBuild] ;copy = META.json ; ;; before release ;[Git::Check] ; ensure all files checked in ;allow_dirty = dist.ini ;allow_dirty = Changes ;allow_dirty = README.pod ;allow_dirty = META.json ; ;[CheckMetaResources] ; ensure META has 'resources' data ;[CheckPrereqsIndexed] ; ensure prereqs are on CPAN ;[CheckChangesHasContent] ; ensure Changes has been updated ;[CheckExtraTests] ; ensure xt/ tests pass ;[TestRelease] ; ensure t/ tests pass ;[ConfirmRelease] ; prompt before uploading ; ;; releaser ;[UploadToCPAN] ; uploads to CPAN ; ;; after release ;[Git::Commit / Commit_Dirty_Files] ; commit Changes (as released) ; ;[Git::Tag] ; tag repo with custom tag ;tag_format = release-%v ; ;; NextRelease acts *during* pre-release to write $VERSION and ;; timestamp to Changes and *after* release to add a new {{$NEXT}} ;; section, so to act at the right time after release, it must actually ;; come after Commit_Dirty_Files but before Commit_Changes in the ;; dist.ini. It will still act during pre-release as usual ; ;[NextRelease] ; ;[Git::Commit / Commit_Changes] ; commit Changes (for new dev) ; ;[Git::Push] ; push repo to remote ;push_to = origin t000755001750001750 012230550312 20252 5ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54pman.t100644001750001750 72612230550312 21517 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# pman testing # ------ pragmas use strict; use warnings; use Test::More tests => 2; # ------ define variable my $output = undef; # output from pman # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/pman Carp 2>&1`; }; is($?, 256, "pman runs"); like($output, qr/NAME.*[Cc]arp - \w.*SYNOPSIS.*DESCRIPTION/ms, "found Carp"); pmls.t100644001750001750 61712230550312 21536 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# pmls testing # ------ pragmas use strict; use warnings; use Test::More tests => 2; # ------ define variable my $output = undef; # output from pmls # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/pmls Tie::Hash 2>&1`; }; is($?, 0, "pmls runs"); like($output, qr/Tie.*Hash.pm/, "found Tie::Hash"); pods.t100644001750001750 60512230550312 21525 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# pods testing # ------ pragmas use strict; use warnings; use Test::More tests => 2; # ------ define variable my $output = undef; # output from pods # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/pods 2>&1`; }; is($?, 0, "pods runs"); like($output, qr/Tie.*Hash.pm/, "found Tie::Hash"); MANIFEST100644001750001750 120512230550312 21276 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54Changes LICENSE MANIFEST META.yml Makefile.PL Makefile.lame README TODO bin/basepods bin/faqpods bin/modpods bin/pfcat bin/plxload bin/pmall bin/pman bin/pmcat bin/pmcheck bin/pmdesc bin/pmeth bin/pmexp bin/pmfunc bin/pminclude bin/pminst bin/pmload bin/pmls bin/pmpath bin/pmvers bin/podgrep bin/podpath bin/pods bin/podtoc bin/sitepods bin/stdpods dist.ini lib/Devel/Loaded.pm lib/pmtools.pm t/basepods.t t/faqpods.t t/head.pl t/modpods.t t/pfcat.t t/plxload.t t/pmall.t t/pman.t t/pmcat.t t/pmcheck.t t/pmdesc.t t/pmeth.t t/pmexp.t t/pmfunc.t t/pmload.t t/pmls.t t/pmpath.t t/pmvers.t t/podgrep.t t/pods.t t/podtoc.t t/sitepods.t t/stdpods.t META.yml100644001750001750 107012230550312 21416 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54--- abstract: 'Perl Module Tools' author: - 'Mark Leighton Fisher ' build_requires: {} configure_requires: ExtUtils::MakeMaker: 6.30 dynamic_config: 0 generated_by: 'Dist::Zilla version 4.300036, CPAN::Meta::Converter version 2.131560' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: pmtools requires: perl: 5.008008 version: 1.54 x_contributors: - 'Mark Leighton Fisher ' - 'Mark Leighton Fisher ' pfcat100755001750001750 426612230550312 21752 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # pfcat - cat out function definitions from perlfunc # # this is a command of its own so it can find the right version # ------ pragmas use strict; use warnings; our $VERSION = '1.50'; # ------ define variable my @options = (); # list of podgrep options @options = (); while ($ARGV[0] =~ /^-/) { push @options, shift @ARGV; } die "usage: $0 function\n" unless @ARGV; system "$^X -S podgrep -h @options '@ARGV' `$^X -S podpath perlfunc`"; exit ($? != 0); __END__ =head1 NAME pfcat - grep out function definitions from perlfunc =head1 DESCRIPTION This program uses I program to search your configuration's L for function definitions. It honors a B<-f> flag to format through I and a B<-p> flag to send the output through the pager. (Actually, it just passes these to I.) =head1 EXAMPLES $ pfcat seek (find all seek functions (including sysseek)) $ pfcat -pf sprintf (sprintf function is formated and sent to pager) $ pfcat -f '\bint\b' /usr/local/devperl/lib/5.00554/pod/perlfunc.pod chunk 506 int EXPR int Returns the integer portion of EXPR. If EXPR is omitted, uses `$_'. You should not use this for rounding, because it truncates towards `0', and because machine representations of floating point numbers can sometimes produce counterintuitive results. Usually `sprintf()' or `printf()', or the `POSIX::floor' or `POSIX::ceil' functions, would serve you better. You can also run this using alternate perl binaries, like so: $ oldperl -S pfcat open .... =head1 SEE ALSO podgrep(1) =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". pmall100755001750001750 1150212230550312 21771 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # pmall -- show all installed versions and descs use strict; use warnings; use File::Find qw(find); use Getopt::Std qw(getopts); use Carp; use vars ( q!$opt_v!, # give debug info q!$opt_w!, # warn about missing descs on modules q!$opt_a!, # include relative paths q!$opt_s!, # sort output within each directory ); our $VERSION = '1.50'; $| = 1; getopts('wvas') || die "bad usage"; @ARGV = @INC unless @ARGV; # Globals. wish I didn't really have to do this. use vars ( q!$Start_Dir!, # The top directory find was called with q!%Future!, # topdirs find will handle later ); my $Module; if ($opt_s) { if (open(ME, "-|")) { $/ = ''; while () { chomp; print join("\n", sort split /\n/), "\n"; } exit; } } MAIN: { my %visited; my ($dev,$ino); @Future{@ARGV} = (1) x @ARGV; foreach $Start_Dir (@ARGV) { delete $Future{$Start_Dir}; print "\n<>\n\n" if $opt_v; next unless ($dev,$ino) = stat($Start_Dir); next if $visited{$dev,$ino}++; next unless $opt_a || $Start_Dir =~ m!^/!; find(\&wanted, $Start_Dir); } exit; } sub modname { local $_ = $File::Find::name; if (index($_, $Start_Dir . '/') == 0) { substr($_, 0, 1+length($Start_Dir)) = ''; } s { / } {::}gx; s { \.p(m|od)$ } {}x; return $_; } sub wanted { if ( $Future{$File::Find::name} ) { warn "\t(Skipping $File::Find::name, qui venit in futuro.)\n" if 0 and $opt_v; $File::Find::prune = 1; return; } return unless /\.pm$/ && -f; $Module = &modname; my $file = $_; unless (open(POD, "< $file")) { warn "\tcannot open $file: $!"; # if $opt_w; return 0; } $: = " -:"; local $/ = ''; local $_; while () { if (/=head\d\s+NAME/) { chomp($_ = ); s/^.*?-\s+//s; s/\n/ /g; #write; my $v; if (defined ($v = getversion($Module))) { print "$Module ($v) "; } else { print "$Module "; } print "- $_\n"; return 1; } } warn "\t(MISSING DESC FOR $File::Find::name)\n" if $opt_w; return 0; } sub getversion { my $mod = shift; my $vers = `$^X -m$mod -e 'print \$${mod}::VERSION' 2>&1`; #my $vers = `$^X -m$mod -e 'print \$${mod}::VERSION' 2>/dev/null`; # 2> due to errors from MM_Unix etc $vers =~ s/^\s*(.*?)\s*$/$1/; # why is there whitespace here?? return ($vers || undef); } sub getversion_internal { # This should really use system(), because otherwise we bloat. my $mod = shift; local $SIG{__WARN__} = sub {}; eval "local \$^W = 0; require $mod"; if ($@) { warn "Cannot require $mod -- $@\n" if $opt_v; return; } my $vers; { no strict 'refs'; return unless defined ($vers = ${ $mod . "::VERSION" }); } $vers =~ s/^\s*(.*?)\s*$/$1/; # why is there whitespace here?? return $vers; } format = ^<<<<<<<<<<<<<<<<<~~^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $Module, $_ . __END__ =head1 NAME pmall - show all installed versions and descs =head1 SYNOPSIS pmall [-d] [-w] [-a] [-s] pmall - show all installed versions and descs =head1 DESCRIPTION This program runs through all your installed modules and tells you what they're for and what version number they are at. The following options are honored: =over 4 =item -v give debug info =item -w warn about missing descriptions on modules =item -a include relative paths =item -s sort output within each directory =back =head1 HISTORICAL NOTE This program used to be called I and is included in I under that name. However, that name has been usurped by a simpler program. For example, to find the versions of what is in your site-specific directory, the simpler I might be preferred: $ pmdesc `pminst -s | perl -lane 'print $F[1] if $F[0] =~ /site/'` XML::Parser::Expat (2.19) - Lowlevel access to James Clark's expat XML parser XML::Parser (2.19) - A perl module for parsing XML documents =head1 KNOWN BUGS This program takes a long time to run. Some modules don't work right (CPAN.pm, ExtUtils) because of noisy things they do at compile time or poor formatting of the pod. =head1 SEE ALSO pmdesc(1) pmvers(1) =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". pmcat100755001750001750 265112230550312 21755 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # pmcat -- page a module file # ------ pragmas use strict; use warnings; our $VERSION = '1.50'; # ------ define variables my $pager = undef; # $ENV{PAGER} - output paging program BEGIN { $^W = 1 } BEGIN { die "usage: $0 module ...\n" unless @ARGV } use FindBin qw($Bin); unless ($pager = $ENV{PAGER}) { require Config; $pager = $Config::Config{"pager"} || "more"; } exec "$pager `$^X -S $Bin/pmpath @ARGV`"; __END__ =head1 NAME pmcat - page through a module file =head1 DESCRIPTION Given a module name, figure out the path name and send that to the user's pager. $ pmcat CGI This works also on alternate installed versions of Perl: $ oldperl -S pmcat strict $ filsperl -S pmcat Threads This command is mostly here for people too lazy to type $ more `pmpath CGI` =head1 SEE ALSO pmpath(1) =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". pmeth100755001750001750 1441412230550312 22006 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # pmeth -- show a class's methods # ------ pragmas use strict; use warnings; our $VERSION = '1.50'; # ------ define variables my $ancestor = undef; # ancestor my $errors = 0; # error count my %got_def = (); # got definition already my $name = undef; # symbol name BEGIN { $^W = 1 } BEGIN { die "usage: $0 module\n" unless @ARGV == 1 } $errors = 0; %got_def = (); show_methods($ARGV[0]); show_methods("UNIVERSAL", $ARGV[0]); sub show_methods { my $module = shift; my @indirect = @_; my @baseclasses = @indirect[ 0 .. ($#indirect-1) ]; eval "local \$^W = 0; require $module"; if ($@) { $@ =~ s/at \(eval.*$//; warn "$0: $@"; $errors++; return; } no strict 'refs'; foreach $name ( sort keys %{ $module . "::" } ) { use strict 'refs'; print '[constant] ' if declared($module . "::" . $name); if (defined &{ $module . "::" . $name } ) { print "[overridden] " if $got_def{$name}++; if (@indirect) { print join(" via ", $name, $module, @baseclasses), "\n"; } else { print "$name\n"; } } } if (my @parents = @{ $module . "::ISA" } ) { foreach $ancestor (@parents) { show_methods($ancestor, $module, @indirect); } } } sub declared ($) { use constant 1.01; # don't omit this! my $name = shift; $name =~ s/^::/main::/; my $pkg = caller; my $full_name = $name =~ /::/ ? $name : "${pkg}::$name"; $constant::declared{$full_name}; } exit ($errors != 0); __END__ =head1 NAME pmeth - show a Perl class's methods =head1 DESCRIPTION Given a class name, print out all methods available to that class. It does this by loading in the class module, and walking its symbol table and those of its ancestor classes. A regular method call shows up simply: $ pmeth IO::Socket | grep '^con' confess configure connect connected But one that came from else where is noted with one or more "via" notations: DESTROY via IO::Handle export via Exporter via IO::Handle A base-class method that is unavailable due to being hidden by a close derived-class method by the same name (but accessible via SUPER::) is indicated by a leading "[overridden]" before it: [overridden] new via IO::Handle Constants declared via L have a leading "[constant]" added to the output, but XS C's are not yet so flagged. =head1 EXAMPLES $ pmeth IO::Socket AF_INET AF_UNIX INADDR_ANY INADDR_BROADCAST INADDR_LOOPBACK INADDR_NONE SOCK_DGRAM SOCK_RAW SOCK_STREAM accept bind carp confess configure connect connected croak getsockopt import inet_aton inet_ntoa listen new pack_sockaddr_in pack_sockaddr_un peername protocol recv register_domain send setsockopt shutdown sockaddr_in sockaddr_un sockdomain socket socketpair sockname sockopt socktype timeout unpack_sockaddr_in unpack_sockaddr_un DESTROY via IO::Handle SEEK_CUR via IO::Handle SEEK_END via IO::Handle SEEK_SET via IO::Handle _IOFBF via IO::Handle _IOLBF via IO::Handle _IONBF via IO::Handle _open_mode_string via IO::Handle autoflush via IO::Handle blocking via IO::Handle [overridden] carp via IO::Handle clearerr via IO::Handle close via IO::Handle [overridden] confess via IO::Handle constant via IO::Handle [overridden] croak via IO::Handle eof via IO::Handle error via IO::Handle fcntl via IO::Handle fdopen via IO::Handle fileno via IO::Handle flush via IO::Handle format_formfeed via IO::Handle format_line_break_characters via IO::Handle format_lines_left via IO::Handle format_lines_per_page via IO::Handle format_name via IO::Handle format_page_number via IO::Handle format_top_name via IO::Handle format_write via IO::Handle formline via IO::Handle gensym via IO::Handle getc via IO::Handle getline via IO::Handle getlines via IO::Handle gets via IO::Handle input_line_number via IO::Handle input_record_separator via IO::Handle ioctl via IO::Handle [overridden] new via IO::Handle new_from_fd via IO::Handle opened via IO::Handle output_field_separator via IO::Handle output_record_separator via IO::Handle print via IO::Handle printf via IO::Handle printflush via IO::Handle qualify via IO::Handle qualify_to_ref via IO::Handle read via IO::Handle setbuf via IO::Handle setvbuf via IO::Handle stat via IO::Handle sync via IO::Handle sysread via IO::Handle syswrite via IO::Handle truncate via IO::Handle ungensym via IO::Handle ungetc via IO::Handle untaint via IO::Handle write via IO::Handle _push_tags via Exporter via IO::Handle export via Exporter via IO::Handle export_fail via Exporter via IO::Handle export_ok_tags via Exporter via IO::Handle export_tags via Exporter via IO::Handle export_to_level via Exporter via IO::Handle [overridden] import via Exporter via IO::Handle require_version via Exporter via IO::Handle VERSION via UNIVERSAL can via UNIVERSAL [overridden] import via UNIVERSAL isa via UNIVERSAL =head1 NOTE Perl makes no distinction between functions, procedures, and methods, nor whether they are public or nominally private, nor whether a method is nominally a class method, an object method, or both. They all show up as subs in the package namespace. So if your class says C, you just polluted your namespace with things like croak() and confess(), which will appear to be available as method calls on objects of your class. =head1 SEE ALSO perltoot(1), perlobj(1) =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". pmexp100755001750001750 674112230550312 22006 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # pmexp -- show a module's exports # ------ pragmas use strict; use warnings; our $VERSION = '1.50'; # ------ define variables my $errors = 0; # error count my @list = (); # list of module exports my $module = undef; # module name my %table = (); # module export tags my $tag = undef; # module export tag BEGIN { $^W = 1 } BEGIN { die "usage: $0 module ...\n" unless @ARGV } $errors = 0; for $module (@ARGV) { eval "local \$^W = 0; require $module"; if ($@) { $@ =~ s/at \(eval.*$//; warn "$0: $@"; $errors++; next; } no strict 'refs'; if (@list = @{ $module . "::EXPORT" } ) { use strict 'refs'; print "$module automatically exports ", commify_series(@list), "\n"; } if (@list = @{ $module . "::EXPORT_OK" } ) { print "$module optionally exports ", commify_series(@list), "\n"; } if (%table = %{ $module . "::EXPORT_TAGS" } ) { for $tag (sort keys %table) { print "$module export tag `$tag' includes ", commify_series(@{$table{$tag}}), "\n"; } } } exit($errors != 0); sub commify_series { (@_ == 0) ? '' : (@_ == 1) ? $_[0] : (@_ == 2) ? join(" and ", @_) : join(", ", @_[0 .. ($#_-1)], "and $_[-1]"); } __END__ =head1 NAME pmexp - show a module's exports =head1 DESCRIPTION Given a module name, this program identifies which symbols are automatically exported (in that package's @EXPORT), those which are optionally exported (in that package's @EXPORT_OK), and also lists out the import groups (in that package's %EXPORT_TAGS hash). =head1 EXAMPLES $ pmexp Text::ParseWords Text::ParseWords automatically exports shellwords, quotewords, nested_quotewords, and parse_line Text::ParseWords optionally exports old_shellwords $ pmexp Text::Wrap Text::Wrap automatically exports wrap and fill Text::Wrap optionally exports $columns, $break, and $huge $ pmexp Fcntl Fcntl automatically exports FD_CLOEXEC, F_DUPFD, F_EXLCK, F_GETFD, F_GETFL, F_GETLK, F_GETLK64, F_GETOWN, F_POSIX, F_RDLCK, F_SETFD, F_SETFL, F_SETLK, F_SETLK64, F_SETLKW, F_SETLKW64, F_SETOWN, F_SHLCK, F_UNLCK, F_WRLCK, O_ACCMODE, O_APPEND, O_ASYNC, O_BINARY, O_CREAT, O_DEFER, O_DSYNC, O_EXCL, O_EXLOCK, O_LARGEFILE, O_NDELAY, O_NOCTTY, O_NONBLOCK, O_RDONLY, O_RDWR, O_RSYNC, O_SHLOCK, O_SYNC, O_TEXT, O_TRUNC, and O_WRONLY Fcntl optionally exports FAPPEND, FASYNC, FCREAT, FDEFER, FEXCL, FNDELAY, FNONBLOCK, FSYNC, FTRUNC, LOCK_EX, LOCK_NB, LOCK_SH, and LOCK_UN Fcntl export tag `Fcompat' includes FAPPEND, FASYNC, FCREAT, FDEFER, FEXCL, FNDELAY, FNONBLOCK, FSYNC, and FTRUNC Fcntl export tag `flock' includes LOCK_SH, LOCK_EX, LOCK_NB, and LOCK_UN =head1 BUGS The output formatting should be nicer, perhaps using C and C. =head1 SEE ALSO pmeth(1), perlmod(1), Exporter(3). =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". head.pl100755001750001750 42312230550312 21632 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t#!/usr/bin/env perl # head(1) utility for testing # ------ pragmas use warnings; use strict; # ------ define variables my $count = 0; # line count my $line = undef; # current input line while ($line = <>) { if (++$count < 100) { print $line; next; } exit(0); } pfcat.t100644001750001750 76512230550312 21664 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# pfcat testing # ------ pragmas use strict; use warnings; use Test::More tests => 2; # ------ define variable my $output = undef; # output from pfcat # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/pfcat seek 2>&1`; }; is($?, 0, "pfcat runs"); like($output, qr/There is no .*systell.* function.\s+Use .*sysseek/, "catted module function"); pmall.t100644001750001750 72012230550312 21663 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# pmall testing # ------ pragmas use strict; use warnings; use Test::More tests => 2; # ------ define variable my $output = undef; # output from pmall # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/pmall | t/head.pl 2>&1`; }; is($?, 0, "pmall runs"); like($output, qr/^\w+.* \(\d+\.\d+\) - \w+/ms, "synopsized all modules"); pmcat.t100644001750001750 72012230550312 21662 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# pmcat testing # ------ pragmas use strict; use warnings; use Test::More tests => 2; # ------ define variable my $output = undef; # output from pmcat # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/pmcat Carp 2>&1`; }; is($?, 0, "pmcat runs"); like($output, qr/.*package Carp\;.*\=head1 SYNOPSIS/ms, "catted Carp"); pmeth.t100644001750001750 63512230550312 21700 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# pmeth testing # ------ pragmas use strict; use warnings; use Test::More tests => 2; # ------ define variable my $output = undef; # output from pmeth # ------ add other pmtools to PATH temporarily $ENV{'PATH'} = 'blib/script:' . $ENV{PATH}; eval { $output = `bin/pmeth Tie::Hash 2>&1`; }; is($?, 0, "pmeth runs"); like($output, qr/CLEAR.*EXISTS/ms, "list methods of a module"); pmexp.t100644001750001750 72612230550312 21715 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# pmexp testing # ------ pragmas use strict; use warnings; use Test::More tests => 2; # ------ define variable my $output = undef; # output from pmexp # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/pmexp Carp 2>&1`; }; is($?, 0, "pmexp runs"); like($output, qr/Carp automatically exports confess/, "listed module exports"); pmdesc100755001750001750 534712230550312 22131 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # pmdesc -- show NAME section # ------ pragmas use strict; use warnings; our $VERSION = '1.50'; # ------ define variables my $errors = 0; # error count my $fullpath = undef; # full module path my $module = undef; # module name my $vers = undef; # module version BEGIN { $^W = 1 } use FindBin qw($Bin); $errors = 0; MODULE: for $module (@ARGV) { $fullpath = `$Bin/pmpath $module`; if ($?) { $errors++; next; } chomp $fullpath; unless (open(POD, "< $fullpath")) { warn "$0: cannot open $fullpath: $!"; $errors++; next; } local $/ = ''; local $_; while () { if (/=head\d\s+NAME/) { chomp($_ = ); s/^.*?-\s+//s; s/\n/ /g; #write; my $v; if (defined ($vers = getversion($module))) { print "$module ($vers) "; } else { print "$module "; } print "- $_\n"; next MODULE; } } print "no description found\n"; $errors++; } sub getversion { my $module = shift; my $vers = `$^X -S $Bin/pmvers $module 2>/dev/null`; return if $?; chomp $vers; return $vers; } exit ($errors != 0); __END__ =head1 NAME pmdesc - print out version and whatis description of perl modules =head1 DESCRIPTION Given one or more module names, show the version number (if known) and the `whatis' line, that is, the NAME section's description, typically used for generation whatis databases. =head1 EXAMPLES $ pmdesc IO::Socket IO::Socket (1.25) - Object interface to socket communications $ oldperl pmdesc IO::Socket IO::Socket (1.1603) - Object interface to socket communications $ pmdesc `pminst -s | perl -lane 'print $F[1] if $F[0] =~ /site/'` XML::Parser::Expat (2.19) - Lowlevel access to James Clark's expat XML parser XML::Parser (2.19) - A perl module for parsing XML documents =head1 RESTRICTIONS This only works on modules. It should also work on filenames, but then it's a bit tricky finding out the package to call the VERSION method on. =head1 SEE ALSO pmdesc(1) pminst(1) pmpath(1) pmvers(1) =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". pmfunc100755001750001750 412412230550312 22136 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # pmfunc -- show a function # ------ pragmas use strict; use warnings; our $VERSION = '1.50'; # ------ define variables my $errors = 0; # error count my $file = undef; # module file path my $function = undef; # function name my $module = undef; # module name my $ok = undef; # OK count BEGIN { $^W = 1 } BEGIN { die "usage: $0 module ...\n" unless @ARGV } use FindBin qw($Bin); $errors = 0; for my $arg (@ARGV) { ($module, $function) = $arg =~ /(\w.*)::(\w+)$/; $file = `$^X -S $Bin/pmpath $module`; if ($?) { $errors++; next; } chomp $file; system $^X, '-ne', '$ok++,print if /^sub\s+' . $function . '\b/ .. /^}\s*$/;' . ' END { $? = ($ok == 0) }', $file; $errors++ if $?; } exit ($errors != 0); __END__ =head1 NAME pmfunc - cat out a function from a module =head1 DESCRIPTION Given a fully-qualified function, this program opens up the file and attempts to cat out the source for that function. =head1 EXAMPLES $ pmfunc Cwd::getcwd sub getcwd { abs_path('.'); } =head1 RESTRICTIONS 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 C, 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` =head1 RESTRICTIONS =head1 SEE ALSO =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". pminst100755001750001750 1057512230550312 22207 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # pminst -- find modules whose names match this pattern # ------ pragmas use strict; use warnings; our $VERSION = '1.50'; # ------ define variables my $pattern = undef; # module name pattern our $startdir = undef; # starting directory my $tmpname = undef; # temp version of full module name BEGIN { $^W = 1 } use Getopt::Std qw(getopts); use File::Find; getopts('ls') || die "bad usage"; if (@ARGV == 0) { @ARGV = ('.'); } die "usage: $0 [-l] [-s] pattern\n" unless @ARGV == 1; $pattern = shift(); $pattern =~ s,::,/,g; no lib '.'; use vars qw($opt_l $opt_s %seen); for $startdir (@INC) { next if (!-d $startdir); find(\&wanted, $startdir); } sub wanted { if (-d && /^[a-z]/) { # this is so we don't go down site_perl etc too early $File::Find::prune = 1; return; } # Some expansions of @INC have subdirs of other @INC directories in them; # to wit: # /opt/perl/lib/site_perl/5.8.8 # /opt/perl/lib/site_perl # This will result in output, when looking for module Foo: # Foo # 5.8.8:Foo # We add full module paths for found modules to %seen so # we can skip them the next time around. return unless ( /\.pm$/ and not exists $seen{$File::Find::name} ); local $_ = $File::Find::name; ($tmpname = $_) =~ s{^\Q$startdir/}{}; return unless $tmpname =~ /$pattern/o; if ($opt_l) { s{^(\Q$startdir\E)/}{$1 } if $opt_s; } else { s{^\Q$startdir/}{}; s/\.pm$//; s{/}{::}g; print "$startdir " if $opt_s; } $seen{$File::Find::name}=1; print $_, "\n"; } __END__ =head1 NAME pminst - find modules whose names match this pattern =head1 SYNOPSIS pminst [B<-s>] [B<-l>] [I] =head1 DESCRIPTION Without arguments, show the names of all installed modules. Given a pattern, show all module names that match it. The B<-l> flag will show the full pathname. The B<-s> flag will separate the base directory from @INC from the module portion itself. =head1 EXAMPLES $ pminst (lists all installed modules) $ pminst Carp CGI::Carp Carp $ pminst ^IO:: IO::Socket::INET IO::Socket::UNIX IO::Select IO::Socket IO::Poll IO::Handle IO::Pipe IO::Seekable IO::Dir IO::File $ pminst '(?i)io' IO::Socket::INET IO::Socket::UNIX IO::Select IO::Socket IO::Poll IO::Handle IO::Pipe IO::Seekable IO::Dir IO::File IO Pod::Functions The -s flag provides output with the directory separated by a space: $ pminst -s | sort +1 (lists all modules, sorted by name, but with where they came from) $ oldperl -S pminst -s IO /usr/lib/perl5/i386-linux/5.00404 IO::File /usr/lib/perl5/i386-linux/5.00404 IO::Handle /usr/lib/perl5/i386-linux/5.00404 IO::Pipe /usr/lib/perl5/i386-linux/5.00404 IO::Seekable /usr/lib/perl5/i386-linux/5.00404 IO::Select /usr/lib/perl5/i386-linux/5.00404 IO::Socket /usr/lib/perl5/i386-linux/5.00404 IO /usr/lib/perl5/site_perl LWP::IO /usr/lib/perl5/site_perl LWP::TkIO /usr/lib/perl5/site_perl Tk::HTML::IO /usr/lib/perl5/site_perl Tk::IO /usr/lib/perl5/site_perl IO::Stringy /usr/lib/perl5/site_perl IO::Wrap /usr/lib/perl5/site_perl IO::ScalarArray /usr/lib/perl5/site_perl IO::Scalar /usr/lib/perl5/site_perl IO::Lines /usr/lib/perl5/site_perl IO::WrapTie /usr/lib/perl5/site_perl IO::AtomicFile The -l flag gives full paths: $ filsperl -S pminst -l Thread /usr/local/filsperl/lib/5.00554/i686-linux-thread/Thread/Queue.pm /usr/local/filsperl/lib/5.00554/i686-linux-thread/Thread/Semaphore.pm /usr/local/filsperl/lib/5.00554/i686-linux-thread/Thread/Signal.pm /usr/local/filsperl/lib/5.00554/i686-linux-thread/Thread/Specific.pm /usr/local/filsperl/lib/5.00554/i686-linux-thread/Thread.pm =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". pmload100755001750001750 764212230550312 22132 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # pmload -- show what files a module loads # ------ pragmas use strict; use warnings; our $VERSION = '1.50'; # ------ define variables my $module = undef; # module name my %seen = (); # list of files we've seen before BEGIN { $^W = 1 } die "usage: $0 module\n" unless @ARGV == 1; %seen = %INC; $module = shift; eval "local \$^W = 0; require $module"; if ($@) { $@ =~ s/at \(eval.*$//; die "$0: $@"; } for my $path (values %INC) { print "$path\n" unless $seen{$path}; } __END__ =head1 NAME pmload - show what files a given module loads at compile time =head1 DESCRIPTION Given an argument of a module name, show all the files that are loaded directly or indirectly when the module is used at compile-time. =head1 EXAMPLES $ pmload IO::Handle /usr/local/devperl/lib/5.00554/Exporter.pm /usr/local/devperl/lib/5.00554/Carp.pm /usr/local/devperl/lib/5.00554/strict.pm /usr/local/devperl/lib/5.00554/vars.pm /usr/local/devperl/lib/5.00554/i686-linux/DynaLoader.pm /usr/local/devperl/lib/5.00554/i686-linux/IO/Handle.pm /usr/local/devperl/lib/5.00554/Symbol.pm /usr/local/devperl/lib/5.00554/i686-linux/IO/File.pm /usr/local/devperl/lib/5.00554/SelectSaver.pm /usr/local/devperl/lib/5.00554/i686-linux/Fcntl.pm /usr/local/devperl/lib/5.00554/AutoLoader.pm /usr/local/devperl/lib/5.00554/i686-linux/IO.pm /usr/local/devperl/lib/5.00554/i686-linux/IO/Seekable.pm $ cat `pmload IO::Socket` | wc -l 4015 $ oldperl -S pmload Tk /usr/lib/perl5/site_perl/Tk/Pretty.pm /usr/lib/perl5/Symbol.pm /usr/lib/perl5/site_perl/Tk/Frame.pm /usr/lib/perl5/site_perl/Tk/Toplevel.pm /usr/lib/perl5/strict.pm /usr/lib/perl5/Exporter.pm /usr/lib/perl5/vars.pm /usr/lib/perl5/site_perl/auto/Tk/Wm/autosplit.ix /usr/lib/perl5/site_perl/auto/Tk/Widget/autosplit.ix /usr/lib/perl5/site_perl/Tk.pm /usr/lib/perl5/i386-linux/5.00404/DynaLoader.pm /usr/lib/perl5/site_perl/auto/Tk/Frame/autosplit.ix /usr/lib/perl5/site_perl/auto/Tk/Toplevel/autosplit.ix /usr/lib/perl5/Carp.pm /usr/lib/perl5/site_perl/auto/Tk/autosplit.ix /usr/lib/perl5/site_perl/Tk/CmdLine.pm /usr/lib/perl5/site_perl/Tk/MainWindow.pm /usr/lib/perl5/site_perl/Tk/Submethods.pm /usr/lib/perl5/site_perl/Tk/Configure.pm /usr/lib/perl5/AutoLoader.pm /usr/lib/perl5/site_perl/Tk/Derived.pm /usr/lib/perl5/site_perl/Tk/Image.pm /usr/lib/perl5/site_perl/Tk/Wm.pm /usr/lib/perl5/site_perl/Tk/Widget.pm =head1 NOTE If the programmers used a delayed C, those files won't show up. Furthermore, this doesn't show all possible files that get opened, just those that those up in %INC. Most systems have a way to trace system calls. You can use this to find the real answer. First, get a baseline with no modules loaded. $ strace perl -e 1 2>&1 | perl -nle '/^open\("(.*?)".* = [^-]/ && print $1' /etc/ld.so.cache /lib/libnsl.so.1 /lib/libdb.so.2 /lib/libdl.so.2 /lib/libm.so.6 /lib/libc.so.6 /lib/libcrypt.so.1 /dev/null $ strace perl -e 1 2>&1 | grep -c '^open.*= [^-]' 8 Now add module loads and see what you get: $ strace perl -MIO::Socket -e 1 2>&1 | grep -c '^open.*= [^-]' 24 $ strace perl -MTk -e 1 2>&1 | grep -c '^open.*= [^-]' 35 =head1 SEE ALSO Devel::Loaded, plxload(1). =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". pmpath100755001750001750 367212230550312 22146 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # pmpath -- show path to a perl module # ------ pragmas use strict; use warnings; our $VERSION = '1.50'; # ------ define variables my $errors = 0; # error count my $fullpath = undef; # full path my $module = undef; # module name my $shortpath = undef; # short path BEGIN { $^W = 1 } $errors = 0; for $module (@ARGV) { eval "local \$^W = 0; require $module"; if ($@) { $@ =~ s/at \(eval.*$//; warn "$0: $@"; $errors++; next; } for ($shortpath = $module) { s{::}{/}g; s/$/.pm/; } # print "$module is in " if @ARGV > 1; if (defined($fullpath = $INC{$shortpath})) { print "$fullpath\n"; } else { $errors++; warn "$0: path unavailable in %INC\n"; } } exit ($errors != 0); __END__ =head1 NAME pmpath - show full path to a perl module =head1 SYNOPSIS pmpath module ... =head1 DESCRIPTION For each module name given as an argument, produces its full path on the standard output, one per line. =head1 EXAMPLES $ pmpath CGI /usr/local/devperl/lib/5.00554/CGI.pm $ filsperl -S pmpath IO::Socket CGI::Carp /usr/local/filsperl/lib/5.00554/i686-linux-thread/IO/Socket.pm /usr/local/filsperl/lib/5.00554/CGI/Carp.pm $ oldperl -S pmpath CGI CGI::Imagemap /usr/lib/perl5/CGI.pm /usr/lib/perl5/site_perl/CGI/Imagemap.pm =head1 SEE ALSO pmdesc(1), pmvers(1), pmcat(1). =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". pmvers100755001750001750 366512230550312 22173 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # pmvers -- print out a module's version, if findable # ------ pragmas use strict; use warnings; our $VERSION = '1.50'; # ------ define variables my $errors = 0; # error count my $module = undef; # module name my $version = undef; # module version string BEGIN { $^W = 1 } $errors = 0; for $module (@ARGV) { eval "local \$^W = 0; require $module"; if ($@) { $@ =~ s/at \(eval.*$//; warn "$0: $@"; $errors++; next; } print "$module: " if @ARGV > 1; if (defined($version = $module->VERSION())) { print "$version\n"; } else { $errors++; if (@ARGV > 1) { print "unknown version\n"; } else { warn "$0: unknown version for module `$module'\n"; } } } exit ($errors != 0); __END__ =head1 NAME pmvers - print out a module's version =head1 DESCRIPTION Given one or more module names, show the version number if present. If more than one argument is given, the name of the module will also be printed. Not all modules define version numbers, however. =head1 EXAMPLES $ pmvers CGI 2.46 $ pmvers IO::Socket Text::Parsewords IO::Socket: 1.25 Text::ParseWords: 3.1 $ oldperl -S pmvers CGI 2.42 $ filsperl -S pmvers CGI 2.46 $ pmvers Devel::Loaded pmvers: unknown version for module `Devel::Loaded' =head1 SEE ALSO pmdesc(1), pmpath(1), pmcat(1). =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". podtoc100755001750001750 315312230550312 22137 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # podtoc -- show outline of pods # ------ pragmas use strict; use warnings; our $VERSION = '1.50'; # ------ define variables my $inpod = undef; $/ = ''; $inpod = 0; while (<>) { print "$ARGV\n" if $. == 1; if ($inpod && /^=cut/) { $inpod = 0; next; } if (! $inpod && /^=(?!cut)\w+/) { $inpod = 1; } if ($inpod) { next unless /^=(?:head|item)/; s/=head(\d)/' ' x ( $1 - 1 )/e; s/=item/ * /; s/\n+$/\n/; print; } } continue { if (eof) { $inpod = 0; close ARGV; } } __END__ =head1 NAME podtoc - show outline of pods =head1 DESCRIPTION This program shows the structure of one or more pod documents. =head1 EXAMPLES $ podtoc `pmpath CGI` NAME SYNOPSIS ABSTRACT DESCRIPTION PROGRAMMING STYLE CALLING CGI.PM ROUTINES * 1. Use another name for the argument, if one is available. For example, -value is an alias for -values. * 2. Change the capitalization, e.g. -Values (etc) =head1 SEE ALSO pod2man(1), perlpod(1). =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". pmdesc.t100644001750001750 67712230550312 22044 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# pmdesc testing # ------ pragmas use strict; use warnings; use Test::More tests => 2; # ------ define variable my $output = undef; # output from pmdesc # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/pmdesc Carp 2>&1`; }; is($?, 0, "pmdesc runs"); like($output, qr/Carp \(\d+\.\d+\) - \w/, "described a module"); pmfunc.t100644001750001750 77212230550312 22055 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# pmfunc testing # ------ pragmas use strict; use warnings; use Test::More tests => 1; # ------ define variable my $output = undef; # output from pmfunc # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/pmfunc Cwd::getcwd 2>&1`; }; isnt($?, 127, "pmfunc runs"); # TODO: add tests after I get pmfunc working again # like($output, qr/blessed.*dualvar.*isdual.*isvstring.*isweak/ms, # "list function body"); pmload.t100644001750001750 66112230550312 22036 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# pmload testing # ------ pragmas use strict; use warnings; use Test::More tests => 2; # ------ define variable my $output = undef; # output from pmload # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/pmload Tie::Hash 2>&1`; }; is($?, 0, "pmload runs"); like($output, qr/strict.pm/ms, "listed loaded modules"); pmpath.t100644001750001750 62712230550312 22055 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# pmpath testing # ------ pragmas use strict; use warnings; use Test::More tests => 2; # ------ define variable my $output = undef; # output from pmpath # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/pmpath Tie::Hash 2>&1`; }; is($?, 0, "pmpath runs"); like($output, qr/Tie.*Hash.pm/, "found Tie::Hash"); pmvers.t100644001750001750 66012230550312 22075 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# pmvers testing # ------ pragmas use strict; use warnings; use Test::More tests => 2; # ------ define variable my $output = undef; # output from pmvers # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/pmvers Tie::Hash 2>&1`; }; is($?, 0, "pmvers runs"); like($output, qr/^\d+\.\d/, "found version of Tie::Hash"); podtoc.t100644001750001750 75212230550312 22053 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# podtoc testing # ------ pragmas use strict; use warnings; use Test::More tests => 2; # ------ define variable my $output = undef; # output from podtoc # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/podtoc bin/podtoc 2>&1`; }; is($?, 0, "podtoc runs"); like( $output, qr/NAME.*DESCRIPTION.*EXAMPLES.*SEE ALSO.*AUTHORS and COPYRIGHTS.*LICENSE/ms, "found Table of Contents" ); faqpods100755001750001750 307612230550312 22310 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # faqpods - print out the paths to the faqs # # this is a perl program not a shell script # so that we can use the correct perl # ------ pragmas use strict; use warnings; our $VERSION = '1.50'; open(PROG, "$^X -S basepods |") || die "can't fork: $!"; while () { print if /perlfaq/; } __END__ =head1 NAME faqpods - print out pod paths for the standard perl faqs =head1 DESCRIPTION This program uses your configuration's C directory to look up the full paths to those pod pages. Any files in that directory whose names start in C will be printed to the standard output, one per line. This is normally used in backticks to produce a list of filenames for other commands. =head1 EXAMPLES $ podgrep typeglob `faqpods` .... You can also run this using alternate perl binaries, like so: $ podgrep -i thread `filsperl faqpods` .... =head1 SEE ALSO basepods(1), modpods(1), pods(1), sitepod(1), podpath(1), and stdpod(1). =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". modpods100755001750001750 460512230550312 22317 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # modpods - print out all module pod paths # # this is a perl program not a shell script # so that we can use the correct perl # ------ pragmas use strict; use warnings; our $VERSION = '1.50'; system $^X, "-S", "pminst", "-l"; __END__ =head1 NAME modpods - print out paths for the standard modules =head1 DESCRIPTION This program outputs the paths to all installed modules on your systems. This includes both the standard modules (which the I command produces) and the site-specific ones (which the I command produces). This is just a front-end for calling I, supplied to make it more obvious what it does. =head1 EXAMPLE This finds all the modules whose documentation mentions destructors, and cats it out at you. $ podgrep -i destructor `modpods` =head1 /usr/local/devperl/lib/5.00554/i686-linux/DB_File.pm chunk 371 Having read L you will probably have already guessed that the error is caused by the extra copy of the tied object stored in C<$X>. If you haven't, then the problem boils down to the fact that the B destructor, DESTROY, will not be called until I references to the tied object are destroyed. Both the tied variable, C<%x>, and C<$X> above hold a reference to the object. The call to untie() will destroy the first, but C<$X> still holds a valid reference, so the destructor will not get called and the database file F will remain open. The fact that Berkeley DB then reports the attempt to open a database that is alreday open via the catch-all "Invalid argument" doesn't help. =head1 /usr/local/devperl/lib/5.00554/Tie/Array.pm chunk 40 Normal object destructor method. =head1 SEE ALSO podgrep(1), modpods(1), pods(1), sitepods(1), podpath(1), and stdpod(1). =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". plxload100755001750001750 444412230550312 22316 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # plxload -- show what files a perl program loads # ------ pragmas use strict; use warnings; our $VERSION = '1.50'; # ------ define variables my $filename = undef; # program filename BEGIN { $^W = 1 } BEGIN { die "usage: $0 filename\n" unless @ARGV == 1 } $filename = shift; use FindBin qw($Bin); exec "$^X -I$Bin -MDevel::Loaded -S -c $filename 2>/dev/null"; __END__ =head1 NAME plxload - show what files a perl program loads at compile time =head1 SYNOPSYS $ plxload =head1 DESCRIPTION This program is used to show what modules a program would load at compile time via C. Because this installs an at-exit handler and then uses Perl's B<-c> flag for compile only, it will not find modules loaded at run-time. Use the Devel::Loaded module for that. =head1 EXAMPLES $ plxload perldoc /usr/local/devperl/lib/5.00554/Exporter.pm /usr/local/devperl/lib/5.00554/strict.pm /usr/local/devperl/lib/5.00554/vars.pm /usr/local/devperl/lib/5.00554/i686-linux/Config.pm /usr/local/devperl/lib/5.00554/Getopt/Std.pm $ plxload /usr/src/perl5.005_54/installhtml /usr/local/devperl/lib/5.00554/Carp.pm /usr/local/devperl/lib/5.00554/Exporter.pm /usr/local/devperl/lib/5.00554/auto/Getopt/Long/autosplit.ix /usr/local/devperl/lib/5.00554/strict.pm /usr/local/devperl/lib/5.00554/vars.pm /usr/local/devperl/lib/5.00554/Pod/Functions.pm /usr/local/devperl/lib/5.00554/Getopt/Long.pm /usr/local/devperl/lib/5.00554/i686-linux/Config.pm /usr/local/devperl/lib/5.00554/lib.pm /home/tchrist/perllib/Pod/Html.pm /usr/local/devperl/lib/5.00554/Cwd.pm /usr/local/devperl/lib/5.00554/AutoLoader.pm =head1 SEE ALSO L and pmload(1). =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". pmcheck100755001750001750 253412230550312 22263 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # pmcheck -- check that Perl is set up correctly for Perl modules # ------ pragmas use strict; use warnings; our $VERSION = '1.50'; # ------ define variables my $dir = undef; # directory in @INC my $errors = 0; # count of errors found for $dir (@INC) { if (!-e $dir) { print "'$dir' is in \@INC but does not exist\n"; $errors++; next; } if (!-d $dir) { print "'$dir' is in \@INC but is not a directory\n"; $errors++; next; } if (!-r $dir) { print "'$dir' is in \@INC but you cannot read it\n"; $errors++; next; } } exit($errors != 0); __END__ =head1 NAME pmcheck - check that Perl is set up correctly for Perl modules =head1 DESCRIPTION pmcheck checks that Perl is correctly set up for Perl modules. For now, pmcheck just verifies that the entries in @INC are existing readable directories. =head1 SEE ALSO pmdirs(1), pmpath(1) =head1 AUTHOR and COPYRIGHTS Copyright (C) 2012-2013 Mark Leighton Fisher. =head1 LICENSE 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.) podgrep100755001750001750 1034212230550312 22325 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # podgrep -- grep in pod sections only # ------ pragmas use strict; use warnings; use Getopt::Std qw(getopts); our $VERSION = '1.50'; # ------ define variables my $chunk = undef; # chunk count my $file = undef; # file name my $inmatch = undef; # TRUE if inside match my $inpod = undef; # TRUE if inside POD my $only_header = undef; # copy of $opt_h my $opt_f = undef; # output plain text, paged if -p my $opt_h = undef; # output only POD headers my $opt_i = undef; # case-insensitive pattern my $opt_p = undef; # use $ENV{PAGER} to page output my $orig_pattern = undef; # original pattern to search for my $pager = undef; # contents of $ENV{PAGER} my $pattern = undef; # pattern to search for getopts("fhpi") || die "usage: $0 [-i] [-f] [-h] [-p] pattern [podfiles ...]"; $/ = ''; $only_header = $opt_h; $orig_pattern = $pattern = shift; $pattern = '^=.*' . $pattern if $only_header; $pattern .= '(?i)' if $opt_i; if ($opt_p) { unless ($pager = $ENV{PAGER}) { require Config; $pager = $Config::Config{"pager"} || "more"; } } if ($opt_f) { if ($opt_p) { open(STDOUT, "| pod2text | $pager '+/$orig_pattern'"); } else { open(STDOUT, "| pod2text"); } } elsif ($opt_p) { open(STDOUT, "| $pager '+/$orig_pattern'"); } ($file, $chunk) = ('-', 0); while (<>) { if ($inpod && /^=cut/) { $inmatch = $inpod = 0; next; } if (! $inpod && /^=(?!cut)\w+/) { $inpod = 1; } if ($inmatch && /^=\w+/) { $inmatch = 0; } if ($inpod && !$inmatch && /$pattern/o) { print "=head1 $ARGV chunk $.\n\n" unless $file eq $ARGV && $chunk+1 == $.; ($file, $chunk) = ($ARGV, $.); print; $inmatch = 1 if $only_header; next; } print if $inmatch; } continue { if (eof) { $inmatch = $inpod = 0; ($file, $chunk) = ('-', 0); close ARGV; } } close STDOUT; __END__ =head1 NAME podgrep - grep in pod sections only =head1 SYNOPSIS podgrep [B<-i>] [B<-p>] [B<-f>] [B<-h>] I [ I ... ] =head1 DESCRIPTION This program searches each paragraph in a pod document and prints each paragraph that matches the supplied pattern. This pod may be mixed with program code, such as in a module. Options are: =over 4 =item -i means case insensitive match =item -p means page output though the user's pager. The pager will be primed with an argument to search for the string. This highlights the result. =item -f means format output though the I program. =item -h means check for matches in pod C<=head> and C<=item> headers alone, and to keep printing podagraphs until the next header is found. =back =head1 EXAMPLES $ podgrep mail `pmpath CGI` (prints out podagraphs from the CGI.pm manpage that mention mail) $ podgrep -i destructor `sitepods` (prints out podagraphs that mention destructors in the site-installed pods) $ podgrep -i 'type.?glob' `stdpods` (prints out podagraphs that mention typeglob in the standard pods) $ podgrep -hpfi "lock" `faqpods` (prints out all podagraphs with "lock" in the headers case-insensitively, then formats these with pod2text, then shows them in the pager with matches high-lighted) $ podgrep -fh seek `podpath perlfunc` (prints out and formats podagraphs from the standard perlfunc manpage whose headers or items contain "seek".) =head1 SEE ALSO faqpods(1), pfcat(1), pmpath(1), pod2text(1), podpath(1), sitepods(1), stdpods(1), and tcgrep(1). =head1 NOTE For a pager, the author likes these environment settings (in the login startup, of course): $ENV{PAGER} = "less"; $ENV{LESS} = "MQeicsnf"; =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". podpath100755001750001750 301312230550312 22301 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # podpath - print the path to the pod # ------ pragmas use strict; use warnings; our $VERSION = '1.50'; for (@ARGV) { if ( /^perl/ ) { system("$^X -S stdpods | grep $_"); } else { system("$^X -S pmpath $_"); } } __END__ =head1 NAME podpath - print the path to the pod =head1 DESCRIPTION This is just a front-end that calls either I or I depending on what it looks like. It works on both regular the standard podpages and the module ones. =head1 EXAMPLES $ podpath Cwd /usr/local/devperl/lib/5.00554/Cwd.pm It works with alternate installations, too: $ devperl -S podpath perlfunc /usr/local/devperl/lib/5.00554/pod/perlfunc.pod $ oldperl -S podpath IO::Handle /usr/lib/perl5/i386-linux/5.00404/IO/Handle.pm $ filsperl -S podpath Thread /usr/local/filsperl/lib/5.00554/i686-linux-thread/Thread.pm =head1 SEE ALSO stdpods(1), pmpath(1), perlmodlib(1). =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". stdpods100755001750001750 257312230550312 22334 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # stdpods - print out the paths to the modules # that this site added # # this is a perl program not a shell script # so that we can use the correct perl # ------ pragmas use strict; use warnings; our $VERSION = '1.50'; system("$^X -S basepods"); open(PROG, "$^X -S modpods |") || die "can't fork: $!"; while () { print unless /site_perl/; } close PROG; __END__ =head1 NAME stdpods - print out the paths to the modules that came with Perl =head1 DESCRIPTION This program shows the paths to module pods that are I in the I directories. This is the documentation that came with the standard system. =head1 EXAMPLES $ podgrep closure `stdpods` =head1 SEE ALSO podgrep(1), faqpods(1), modpods(1), pods(1), podpath(1), and sitepod(1). =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". faqpods.t100644001750001750 66412230550312 22222 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# faqpods testing # ------ pragmas use strict; use warnings; use Test::More tests => 2; # ------ define variable my $output = undef; # output from faqpods # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/faqpods 2>&1`; }; is($?, 0, "faqpods runs"); like($output, qr/perlfaq[0-9].pod/, "found a Perl FAQ POD"); modpods.t100644001750001750 65112230550312 22226 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# modpods testing # ------ pragmas use strict; use warnings; use Test::More tests => 2; # ------ define variable my $output = undef; # output from modpods # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/modpods 2>&1`; }; is($?, 0, "modpods runs"); like($output, qr/Tie.*Hash.pm/, "found Tie::Hash"); plxload.t100644001750001750 102312230550312 22236 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# plxload testing # ------ pragmas use strict; use warnings; use Test::More tests => 1; # ------ define variable my $output = undef; # output from plxload # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/plxload bin/plxload 2>&1`; }; is($output, "", "modules loaded"); # TODO: Add tests after I get plxload working again #is($?, 0, "plxload runs"); #like($output, qr/Tie.*Hash.pm/, "listed loaded modules"); pmcheck.t100644001750001750 64012230550312 22171 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# pmcheck testing # ------ pragmas use strict; use warnings; use Test::More tests => 2; # ------ define variable my $output = undef; # output from pmcheck # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/pmcheck 2>&1`; }; isnt($?, 127, "pmcheck runs"); is(defined($output), 1, "pmcheck had output"); podgrep.t100644001750001750 65612230550312 22226 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# podgrep testing # ------ pragmas use strict; use warnings; use Test::More tests => 2; # ------ define variable my $output = undef; # output from podgrep # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/podgrep DESC bin/podgrep 2>&1`; }; is($?, 0, "podgrep runs"); like($output, qr/^\=head1 DESCRIPTION/ms, "found DESCRIPTION"); stdpods.t100644001750001750 62112230550312 22236 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# stdpods testing # ------ pragmas use strict; use warnings; use Test::More tests => 2; # ------ define variable my $output = undef; # output from stdpods # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/stdpods 2>&1`; }; is($?, 0, "stdpods runs"); like($output, qr/Tie.*Hash.pm/, "found Tie::Hash"); Makefile.PL100644001750001750 340212230550312 22120 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54 use strict; use warnings; use 5.008008; use ExtUtils::MakeMaker 6.30; my %WriteMakefileArgs = ( "ABSTRACT" => "Perl Module Tools", "AUTHOR" => "Mark Leighton Fisher ", "BUILD_REQUIRES" => {}, "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.30" }, "DISTNAME" => "pmtools", "EXE_FILES" => [ "bin/basepods", "bin/faqpods", "bin/modpods", "bin/pfcat", "bin/plxload", "bin/pmall", "bin/pman", "bin/pmcat", "bin/pmcheck", "bin/pmdesc", "bin/pmeth", "bin/pmexp", "bin/pmfunc", "bin/pminclude", "bin/pminst", "bin/pmload", "bin/pmls", "bin/pmpath", "bin/pmvers", "bin/podgrep", "bin/podpath", "bin/pods", "bin/podtoc", "bin/sitepods", "bin/stdpods" ], "LICENSE" => "perl", "NAME" => "pmtools", "PREREQ_PM" => {}, "TEST_REQUIRES" => {}, "VERSION" => "1.54", "test" => { "TESTS" => "t/*.t" } ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { my $tr = delete $WriteMakefileArgs{TEST_REQUIRES}; my $br = $WriteMakefileArgs{BUILD_REQUIRES}; for my $mod ( keys %$tr ) { if ( exists $br->{$mod} ) { $br->{$mod} = $tr->{$mod} if $tr->{$mod} > $br->{$mod}; } else { $br->{$mod} = $tr->{$mod}; } } } unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; my $pp = $WriteMakefileArgs{PREREQ_PM}; for my $mod ( keys %$br ) { if ( exists $pp->{$mod} ) { $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; } else { $pp->{$mod} = $br->{$mod}; } } } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); basepods100755001750001750 374012230550312 22451 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # basepods - print out the standard perl*.pod manpages pod paths # ------ pragmas use strict; use warnings; use Config; our $VERSION = '1.50'; # ------ define variable my $lib = undef; # standard POD library directory $lib = "$Config{'installprivlib'}/pods"; $lib = "$Config{'installprivlib'}/pod" unless -d $lib; opendir(LIB, $lib) || die "$0: can't opendir $lib: $!\n"; while ($_ = readdir(LIB)) { print "$lib/$_\n" if /\.pod$/; } __END__ =head1 NAME basepods - print out pod paths for the standard perl manpages =head1 DESCRIPTION This program uses your configuration's C directory to look up the full paths to those pod pages. Any files in that directory whose names end in C<.pod> will be printed to the standard output, one per line. This is normally used in backticks to produce a list of filenames for other commands. =head1 EXAMPLES $ podgrep typeglob `basepods` $ basepods | grep delt /usr/local/devperl/lib/5.00554/pod/perl5004delta.pod /usr/local/devperl/lib/5.00554/pod/perl5005delta.pod /usr/local/devperl/lib/5.00554/pod/perldelta.pod You can also run this using alternate perl binaries, like so: $ oldperl -S basepods | grep delt /usr/lib/perl5/pod/perldelta.pod $ podgrep -i thread `filsperl basepods | grep delt` .... =head1 SEE ALSO faqpods(1), modpods(1), pods(1), sitepod(1), podpath(1), and stdpod(1). =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". sitepods100755001750001750 274612230550312 22510 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # sitepods - print out the paths to the modules # that this site added # # this is a perl program not a shell script # so that we can use the correct perl # ------ pragmas use strict; use warnings; our $VERSION = '1.50'; open(PROG, "$^X -S modpods |") || die "can't fork: $!"; while () { print if /site_perl/; } __END__ =head1 NAME sitepods - print out the paths to the modules that this site added =head1 DESCRIPTION This program shows the paths to module pods that are in the I directories. =head1 EXAMPLES $ sitepods /usr/local/devperl/lib/site_perl/5.00554/i686-linux/XML/Parser/Expat.pm /usr/local/devperl/lib/site_perl/5.00554/i686-linux/XML/Parser.pm You can also run this using alternate perl binaries, like so: $ oldperl -S sitepods .... =head1 SEE ALSO faqpods(1), modpods(1), pods(1), podpath(1), and stdpod(1). =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". basepods.t100644001750001750 73112230550312 22360 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# basepods testing # ------ pragmas use strict; use warnings; use Test::More tests => 3; # ------ define variable my $output = undef; # output from basepods # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/basepods 2>&1`; }; is($?, 0, "basepods runs"); like($output, qr/perl.pod/, "found Perl POD"); like($output, qr/perlpod.pod/, "found POD POD"); sitepods.t100644001750001750 64212230550312 22413 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/t# sitepods testing # ------ pragmas use strict; use warnings; use Test::More tests => 1; # ------ define variable my $output = undef; # output from sitepods # ------ add pmtools to PATH for testing, so we use the current pmtools $ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"}; eval { $output = `bin/sitepods 2>&1`; }; is($?, 0, "sitepods runs"); # No more tests because we might not have any site-specific PODS Makefile.lame100755001750001750 105212230550312 22525 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54 PROGRAMS=basepods faqpods modpods pfcat plxload pmall pman pmcat \ pmdesc pmdirs pmeth pmexp pmfunc pminst pmload pmls pmpath pmvers podgrep \ podpath pods podtoc sitepods stdpods install: chmod 755 ${PROGRAMS} eval `perl -V:sitelib`; \ mkdir $$sitelib/Devel 2>/dev/null || true; \ cp Loaded.pm $$sitelib/Devel eval `perl -V:installscript`; \ eval `perl -V:installman1dir`; \ eval `perl -V:man1ext`; \ for p in ${PROGRAMS}; do \ cp $$p $$installscript || exit 1; \ pod2man $$p > $$installman1dir/$$p.$$man1ext || exit 1; \ done pminclude100755001750001750 223212230550312 22624 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/bin#!/usr/bin/env perl # pminclude -- show the include path for modules (@INC) use strict; use warnings; our $VERSION = '1.50'; BEGIN { $^W = 1 } for my $inc (@INC) { print "$inc\n"; } __END__ =head1 NAME pminclude - show the include path for modules (@INC) =head1 DESCRIPTION This is mostly here for people too lazy to type: $ perl -V | tail =head1 EXAMPLES $ pminclude /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl =head1 SEE ALSO pmls(1), pmpath(1) =head1 AUTHORS and COPYRIGHTS Copyright (C) 2013 Mark Leighton Fisher. =head1 LICENSE 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". lib000755001750001750 012230550312 20555 5ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54pmtools.pm100644001750001750 343412230550312 22754 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/libpackage pmtools; use strict; use warnings; package pmtools; our $VERSION = '1.54'; 1; # ------ From Tom Christiansen's original README file for pmtools: # This is pmtools -- a suite of small programs to help manage modules. # The names are totally preliminary, and in fact, so is the code. We follow # the "keep it small" notion of many tiny tools each doing one thing well, # eschewing giant megatools with millions of options. # # Tom Christiansen # tchrist@perl.com =head1 NAME pmtools - Perl Module Tools =head1 SYNOPSIS pmdesc module ... pmpath module ... pmvers module ... ... sitepods ... =head1 DESCRIPTION Perl Modules Tools (pmtools) is a suite of tools designed originally by Tom Christiansen. For each module name given as an argument, produces its full path on the standard output, one per line. =head1 EXAMPLES $ pmpath CGI /usr/local/devperl/lib/5.00554/CGI.pm $ filsperl -S pmpath IO::Socket CGI::Carp /usr/local/filsperl/lib/5.00554/i686-linux-thread/IO/Socket.pm /usr/local/filsperl/lib/5.00554/CGI/Carp.pm $ oldperl -S pmpath CGI CGI::Imagemap /usr/lib/perl5/CGI.pm /usr/lib/perl5/site_perl/CGI/Imagemap.pm =head1 SEE ALSO pmdesc(1), pmvers(1), pmcat(1). =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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". Devel000755001750001750 012230550312 21614 5ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/libLoaded.pm100755001750001750 543612230550312 23515 0ustar00markleightonfishermarkleightonfisher000000000000pmtools-1.54/lib/Devel# Loaded.pm -- show what files were loaded package Devel::Loaded; # ABSTRACT: pmtools - Perl Module Tools # ------ pragmas use strict; use warnings; use File::Spec; our $VERSION = '1.54'; # ----- define variable my $path = undef; # current module path our %Seen = (); # track whether we've seen this module before BEGIN { %Seen = %INC } END { # get last part of Devel::Loaded path; handle File::Spec->canonpath() removing '.' from '.pm' my $devel_loaded = File::Spec->catfile('Devel', 'Loaded.pm'); if ($devel_loaded =~ m/Loadedpm$/) { $devel_loaded =~ s/Loadedpm$/Loaded.pm/; } # delete the matching absolute path from %INC # NOTE: this will fail if you also have directories like ".../MyOwnDevel/Loaded.pm" my $inc_devel_loaded = ""; foreach $path (keys(%INC)) { if ($path =~ m/$devel_loaded$/) { $inc_devel_loaded = $path; last; } } if ($inc_devel_loaded ne "") { #delete $INC{$inc_devel_loaded}; } for my $path (values %INC) { print "$path\n" unless $Seen{$path}; } } 1; __END__ =head1 NAME Devel::Loaded - Post-execution dump of loaded modules =head1 SYNOPSIS perl -MDevel::Loaded programname 2>/dev/null =head1 DESCRIPTION The Devel::Loaded module installs an at-exit handler to generate a dump of all the module files used by a Perl program. If used in conjunction with a I, you find those files loaded in at compile time with C. If you are willing to wait until after the program runs, you can get them all. =head1 EXAMPLES This is compile-time only: $ perl -MDevel::Loaded perldoc 2>/dev/null /usr/local/devperl/lib/5.00554/Exporter.pm /usr/local/devperl/lib/5.00554/strict.pm /usr/local/devperl/lib/5.00554/vars.pm /usr/local/devperl/lib/5.00554/i686-linux/Config.pm /usr/local/devperl/lib/5.00554/Getopt/Std.pm This will also catch run-time loads: #!/usr/bin/perl use Devel::Loaded; ... =head1 SEE ALSO The I and the I programs, which use this technique. Neil Bowers has written a L of Perl modules for getting dependency information (26 of them at the time of writing). =head1 AUTHORS and COPYRIGHTS Copyright (C) 1999 Tom Christiansen. Copyright (C) 2006-2013 Mark Leighton Fisher. =head1 LICENSE 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".