Debian Codegraph @

bin/faqpods

raw
1 #!/usr/bin/env perl
2 # faqpods - print out the paths to the faqs
3 #
4 # this is a perl program not a shell script
5 # so that we can use the correct perl
6
7 # ------ pragmas
8 use strict;
9 use warnings;
10
11 use Config;
12
13 our $VERSION = '2.2.0';
14
15 my $foundcore = 0;
16 open(PROG, "$^X -S basepods |") || die "can't fork: $!";
17 while (<PROG>) {
18 if (/perlfaq/) {
19 print $_;
20 $foundcore = 1;
21 }
22 }
23
24 unless ($foundcore) {
25 my $lib = $Config{'vendorlib'};
26 opendir(LIB, $lib) || die "$0: can't opendir $lib: $!\n";
27 while ($_ = readdir(LIB)) {
28 print "$lib/$_\n" if /perlfaq.*\.pod$/;
29 }
30 }
31
32 __END__
33
34 =head1 NAME
35
36 faqpods - print out pod paths for the standard perl faqs
37
38 =head1 DESCRIPTION
39
40 This program uses your configuration's C<installprivlib> directory
41 to look up the full paths to those pod pages. Any files in that
42 directory whose names start in C<perlfaq> will be printed to the standard
43 output, one per line. This is normally used in backticks to produce
44 a list of filenames for other commands.
45
46 =head1 EXAMPLES
47
48 $ podgrep typeglob `faqpods`
49 ....
50
51 You can also run this using alternate perl binaries, like so:
52
53 $ podgrep -i thread `filsperl faqpods`
54 ....
55
56 =head1 SEE ALSO
57
58 basepods(1), modpods(1), pods(1), sitepod(1), podpath(1), and stdpod(1).
59
60 =head1 AUTHORS and COPYRIGHTS
61
62 Copyright (C) 1999 Tom Christiansen.
63
64 Copyright (C) 2006-2014, 2018 Mark Leighton Fisher.
65
66 =head1 LICENSE
67
68 This is free software; you can redistribute it and/or modify it
69 under the terms of either:
70 (a) the GNU General Public License as published by the Free
71 Software Foundation; either version 1, or (at your option) any
72 later version, or
73 (b) the Perl "Artistic License".
74 (This is the Perl 5 licensing scheme.)
75
76 Please note this is a change from the
77 original pmtools-1.00 (still available on CPAN),
78 as pmtools-1.00 were licensed only under the
79 Perl "Artistic License".