/usr/share/perl5/Module/Install/Admin/Find.pm is in libmodule-install-perl 1.16-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | package Module::Install::Admin::Find;
use strict;
use File::Find ();
use Module::Install::Base ();
use vars qw{$VERSION @ISA};
BEGIN {
$VERSION = '1.16';
@ISA = qw(Module::Install::Base);
}
sub find_extensions {
my $self = shift;
$self->_top->find_extensions(@_);
}
sub find_in_inc {
my ($self, $pkg) = @_;
unless ($pkg =~ /\.pm$/) {
$pkg =~ s!::!/!g;
$pkg = "$pkg.pm";
}
my @found;
foreach my $inc (@INC) {
next if $inc eq $self->_top->{prefix} or ref($inc);
push @found, "$inc/$pkg" if -f "$inc/$pkg";
}
wantarray ? @found : $found[0];
}
sub glob_in_inc {
my ($self, $pkg) = @_;
unless ($pkg =~ /\.pm$/) {
$pkg =~ s!::!/!g;
$pkg = "$pkg.pm";
}
my @found;
foreach my $inc (@INC) {
next if $inc eq $self->_top->{prefix} or ref($inc);
push @found, [ do {
my $p = $_;
$p =~ s!^\Q$inc\E/!!;
$p =~ s!/!::!g;
$p =~ s!\.pm\Z!!gi;
$p
}, $_ ] for grep -e, glob("$inc/$pkg");
}
wantarray ? @found : $found[0];
}
sub find_files {
my ($self, $file, $path) = @_;
$path = '' if not defined $path;
$file = "$path/$file" if length($path);
if (-f $file) {
return ($file);
}
elsif (-d $file) {
my @files = ();
local *DIR;
opendir(DIR, $file) or die "Can't opendir $file";
while (my $new_file = readdir(DIR)) {
next if $new_file =~ /^(\.|\.\.)$/;
push @files, $self->find_files($new_file, $file);
}
return @files;
}
return ();
}
1;
|