| 1 | # | ||||||||||||||||||||
| 2 | # Copyright (c) 2015-2021 Christian Jaeger, copying@christianjaeger.ch | ||||||||||||||||||||
| 3 | # | ||||||||||||||||||||
| 4 | # This is free software, offered under either the same terms as perl 5 | ||||||||||||||||||||
| 5 | # or the terms of the Artistic License version 2 or the terms of the | ||||||||||||||||||||
| 6 | # MIT License (Expat version). See the file COPYING.md that came | ||||||||||||||||||||
| 7 | # bundled with this file. | ||||||||||||||||||||
| 8 | # | ||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | =head1 NAME | ||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | FunctionalPerl::ModuleList | ||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | =head1 SYNOPSIS | ||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | =head1 DESCRIPTION | ||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | =head1 NOTE | ||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | This is alpha software! Read the status section in the package README | ||||||||||||||||||||
| 22 | or on the L<website|http://functional-perl.org/>. | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | =cut | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | package FunctionalPerl::ModuleList; | ||||||||||||||||||||
| 27 | 2 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 28 | 2 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 29 | 2 | ▶ | use warnings FATAL => 'uninitialized'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 30 | 2 | ▶ | use Exporter "import"; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | 2 | our @EXPORT = qw(modulenamelist modulepathlist); | |||||||||||||||||||
| 33 | 2 | our @EXPORT_OK = qw(); | |||||||||||||||||||
| 34 | 2 | our %EXPORT_TAGS = (all => [@EXPORT, @EXPORT_OK]); | |||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 2 | ▶ | use Chj::xopen 'xopen_read'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | 2 | our $modulenameandpathlist; # [[ name, path ] ...] | |||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | 2 | ▶ | sub modulenameandpathlist { | ||||||||||||||||||
|
Subroutine
modulenameandpathlist: called CC=5 SCAR=16.2
Pod
undocumented
| |||||||||||||||||||||
| 41 | 2 | ▶ | $modulenameandpathlist //= do { | ||||||||||||||||||
|
Condition33%1/3
$FunctionalPerl::ModuleList::modulenameandpathlist //= do {
my $f = xopen_read("MANIFEST");
my @m;
local $_;
while (defined($_ = readline $f)) {
chomp $_;
my $path = $_;
next unless s/\.pm$//;
s[^(lib|meta|htmlgen)/][] or die "no match: $_";
s[/][::]gs;
push @m, [$_, $path];
};
$f->xclose;
\@m
}
MC/DC0%0/2
$FunctionalPerl::ModuleList::modulenameandpathlist //= do {
my $f = xopen_read("MANIFEST");
my @m;
local $_;
while (defined($_ = readline $f)) {
chomp $_;
my $path = $_;
next unless s/\.pm$//;
s[^(lib|meta|htmlgen)/][] or die "no match: $_";
s[/][::]gs;
push @m, [$_, $path];
};
$f->xclose;
\@m
}
$FunctionalPerl::ModuleList::modulenameandpathlist
do {
my $f = xopen_read("MANIFEST");
my @m;
local $_;
while (defined($_ = readline $f)) {
chomp $_;
my $path = $_;
next unless s/\.pm$//;
s[^(lib|meta|htmlgen)/][] or die "no match: $_";
s[/][::]gs;
push @m, [$_, $path];
};
$f->xclose;
\@m
}
Truth table33%1/3
A //= B
A= $FunctionalPerl::ModuleList::modulenameandpathlistB= do {
my $f = xopen_read("MANIFEST");
my @m;
local $_;
while (defined($_ = readline $f)) {
chomp $_;
my $path = $_;
next unless s/\.pm$//;
s[^(lib|meta|htmlgen)/][] or die "no match: $_";
s[/][::]gs;
push @m, [$_, $path];
};
$f->xclose;
\@m
}
| |||||||||||||||||||||
| 42 | 2 | my $f = xopen_read "MANIFEST"; | |||||||||||||||||||
| 43 | 2 | my @m; | |||||||||||||||||||
| 44 | 2 | local $_; | |||||||||||||||||||
| 45 | 2 | ▶ | while (<$f>) { ## no critic, $_ is localized | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 46 | 648 | chomp; | |||||||||||||||||||
| 47 | 648 | my $path = $_; | |||||||||||||||||||
| 48 | 648 | ▶ | next unless s/\.pm$//; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 49 | 332 | ▶ | s|^(lib\|meta\|htmlgen)/|| or die "no match: $_"; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 50 | 332 | s|/|::|sg; | |||||||||||||||||||
| 51 | 332 | push @m, [$_, $path] | |||||||||||||||||||
| 52 | } | ||||||||||||||||||||
| 53 | 2 | $f->xclose; | |||||||||||||||||||
| 54 | \@m | ||||||||||||||||||||
| 55 | 2 | } | |||||||||||||||||||
| 56 | } | ||||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | 2 | ▶ | sub modulenamelist { | ||||||||||||||||||
|
Subroutine
modulenamelist: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 59 | 2 | [map { $$_[0] } @{ modulenameandpathlist() }] | |||||||||||||||||||
| 60 | } | ||||||||||||||||||||
| 61 | |||||||||||||||||||||
| 62 | 0 | ▶ | sub modulepathlist { | ||||||||||||||||||
|
Subroutine
modulepathlist: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 63 | 0 | [map { $$_[1] } @{ modulenameandpathlist() }] | |||||||||||||||||||
| 64 | } | ||||||||||||||||||||
| 65 | |||||||||||||||||||||
| 66 | 2 | 1 | |||||||||||||||||||