/usr/share/perl5/Reply/Util.pm is in libreply-perl 0.38-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 78 79 | package Reply::Util;
our $AUTHORITY = 'cpan:DOY';
$Reply::Util::VERSION = '0.38';
use strict;
use warnings;
BEGIN {
if ($] < 5.010) {
require MRO::Compat;
}
else {
require mro;
}
}
use Package::Stash;
use Scalar::Util 'blessed';
use Exporter 'import';
our @EXPORT_OK = qw(
$ident_rx $varname_rx $fq_ident_rx $fq_varname_rx
methods all_packages
);
# XXX this should be updated for unicode
our $varstart_rx = qr/[A-Z_a-z]/;
our $varcont_rx = qr/[0-9A-Z_a-z]/;
our $ident_rx = qr/${varstart_rx}${varcont_rx}*/;
our $sigil_rx = qr/[\$\@\%\&\*]/;
our $varname_rx = qr/$sigil_rx\s*$ident_rx/;
our $fq_ident_rx = qr/$ident_rx(?:::$varcont_rx+)*/;
our $fq_varname_rx = qr/$varname_rx(?:::$varcont_rx+)*/;
sub methods {
my ($invocant) = @_;
my $class = blessed($invocant) || $invocant;
my @mro = (
@{ mro::get_linear_isa('UNIVERSAL') },
@{ mro::get_linear_isa($class) },
);
my @methods;
for my $package (@mro) {
my $stash = eval { Package::Stash->new($package) };
next unless $stash;
push @methods, $stash->list_all_symbols('CODE');
}
return @methods;
}
sub all_packages {
my ($root) = @_;
$root ||= \%::;
my @packages;
for my $fragment (grep { /::$/ } keys %$root) {
next if ref($root) && $root == \%:: && $fragment eq 'main::';
push @packages, (
$fragment,
map { $fragment . $_ } all_packages($root->{$fragment})
);
}
return map { s/::$//; $_ } @packages;
}
=begin Pod::Coverage
methods
all_packages
=end Pod::Coverage
=cut
1;
|