| 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 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 1 | ▶ | use Config; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 1 | our $VERSION = '2.2.0'; | |||||||||
| 14 | |||||||||||
| 15 | 1 | my $foundcore = 0; | |||||||||
| 16 | 1 | ▶ | open(PROG, "$^X -S basepods |") || die "can't fork: $!"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | 1 | ▶ | while (<PROG>) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 229 | ▶ | if (/perlfaq/) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 10 | print $_; | |||||||||
| 20 | 10 | $foundcore = 1; | |||||||||
| 21 | } | ||||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 1 | ▶ | unless ($foundcore) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | 0 | my $lib = $Config{'vendorlib'}; | |||||||||
| 26 | 0 | ▶ | opendir(LIB, $lib) || die "$0: can't opendir $lib: $!\n"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 0 | ▶ | while ($_ = readdir(LIB)) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | 0 | ▶ | print "$lib/$_\n" if /perlfaq.*\.pod$/; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | } | ||||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | __END__ | ||||||||||