pmtools
view release on metacpan or search on metacpan
# 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 (<ME>) {
chomp;
print join("\n", sort split /\n/), "\n";
}
exit;
}
}
MAIN: {
my %visited;
my $file = $_;
unless (open(POD, "< $file")) {
warn "\tcannot open $file: $!";
# if $opt_w;
return 0;
}
$: = " -:";
local $/ = '';
local $_;
while (<POD>) {
if (/=head\d\s+NAME/) {
chomp($_ = <POD>);
s/^.*?-\s+//s;
s/\n/ /g;
#write;
my $v;
if (defined ($v = getversion($Module))) {
print "$Module ($v) ";
$errors++;
next;
}
chomp $fullpath;
unless (open(POD, "< $fullpath")) {
warn "$0: cannot open $fullpath: $!";
$errors++;
next;
}
local $/ = '';
local $_;
while (<POD>) {
if (/=head\d\s+NAME/) {
chomp($_ = <POD>);
s/^.*?-\s+//s;
s/\n/ /g;
#write;
my $v;
if (defined ($vers = getversion($module))) {
print "$module ($vers) ";
bin/podgrep view on Meta::CPAN
our $opt_i = undef; # case-insensitive pattern
our $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;
{
no warnings qw(once);
# ------ pragmas
use strict;
use warnings;
our $VERSION = '2.0.0';
# ------ define variables
my $inpod = undef;
$/ = '';
$inpod = 0;
while (<>) {
print "$ARGV\n" if $. == 1;
if ($inpod && /^=cut/) {
$inpod = 0;
next;
}
if (! $inpod && /^=(?!cut)\w+/) {
( run in 1.314 second using v1.01-cache-2.11-cpan-49f99fa48dc )