/usr/local/bin/cpanm

filter: Statementstmt 29.8% 1144 / 3833 Branchbran 15.4% 317 / 2056 Conditioncond 12.3% 109 / 880 MC/DCmcdc 1.7% 9 / 528 Subroutinesub 37.9% 233 / 614 Podpod 31.4% 98 / 312 totaltotal 23.2% 1910 / 8223 CC 1429 SCAR 52.9
CC
1429
Cov
23%
build_stuff
4294.5
_incr_parse
436.4
install_module
379.9
CRAP 198.7
↑ Summary blib/lib/Pinto/Editor/Edit.pm »
1 #!/usr/local/bin/perl
2 #
3 # This is a pre-compiled source code for the cpanm (cpanminus) program.
4 # For more details about how to install cpanm, go to the following URL:
5 #
6 # https://github.com/miyagawa/cpanminus
7 #
8 # Quickstart: Run the following command and it will install itself for
9 # you. You might want to run it as a root with sudo if you want to install
10 # to places like /usr/local/bin.
11 #
12 # % curl -L https://cpanmin.us | perl - App::cpanminus
13 #
14 # If you don't have curl but wget, replace `curl -L` with `wget -O -`.
15  
16 # DO NOT EDIT -- this is an auto generated file
17  
18 # This chunk of stuff was generated by App::FatPacker. To find the original
19 # file's code, look for the end of this BEGIN block or the string 'FATPACK'
20 2 ▶BEGIN {
Subroutine BEGIN: called CC=3 SCAR=19.6
21 2 my %fatpacked;
22  
23 2 $fatpacked{"App/cpanminus.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'APP_CPANMINUS';
24 package App::cpanminus;our$VERSION="1.7049";1;
25 APP_CPANMINUS
26  
27 2 $fatpacked{"App/cpanminus/Dependency.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'APP_CPANMINUS_DEPENDENCY';
28 0 ▶ package App::cpanminus::Dependency;use strict;use CPAN::Meta::Requirements;sub from_prereqs {my($class,$prereqs,$phases,$types)=@_;my@deps;for my$type (@$types){push@deps,$class->from_versions($prereqs->merged_requirements($phases,[$type])->as_string_hash,$type,)}return@deps}sub from_versions {my($class,$versions,$type)=@_;my@deps;while (my($module,$version)=each %$versions){push@deps,$class->new($module,$version,$type)}@deps}sub merge_with {my($self,$requirements)=@_;$self->{original_version}=$self->version;eval {$requirements->add_string_requirement($self->module,$self->version)};if ($@ =~ /illegal requirements/){warn sprintf("Can't merge requirements for %s: '%s' and '%s'",$self->module,$self->version,$requirements->requirements_for_module($self->module))}$self->{version}=$requirements->requirements_for_module($self->module)}sub new {my($class,$module,$version,$type)=@_;bless {module=>$module,version=>$version,type=>$type || 'requires',},$class}sub module {$_[0]->{module}}sub version {$_[0]->{version}}sub type {$_[0]->{type}}sub requires_version {my$self=shift;if (defined$self->{original_version}){return$self->{original_version}}$self->version}sub is_requirement {$_[0]->{type}eq 'requires'}1;
Subroutine BEGIN: called CC=1 SCAR=4.8
Subroutine BEGIN: called CC=1 SCAR=4.8
Subroutine from_prereqs: not called CC=2 SCAR=15.0
Subroutine from_versions: not called CC=2 SCAR=15.0
Subroutine is_requirement: not called CC=1 SCAR=4.8
Subroutine merge_with: not called CC=2 SCAR=15.0
Subroutine module: not called CC=1 SCAR=4.8
Subroutine new: not called CC=2 SCAR=15.0
Subroutine requires_version: not called CC=2 SCAR=15.0
Subroutine type: not called CC=1 SCAR=4.8
Subroutine version: not called CC=1 SCAR=4.8
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Branch: 3 branches
BranchTrueFalseTotal
if (() = each %$versions) 0 0 0
if ($@ =~ /illegal requirements/) 0 0 0
if (defined $self->{"original_version"}) 0 0 0
Condition0%0/2
$type || 'requires'
l!l
00
MC/DC0%0/1
$type || 'requires'
$type
Truth table0%0/2
A
A= $type
Aresult
11
00
29 APP_CPANMINUS_DEPENDENCY
30  
31 2 $fatpacked{"App/cpanminus/script.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'APP_CPANMINUS_SCRIPT';
32 0 ▶ package App::cpanminus::script;use strict;use Config;use Cwd ();use App::cpanminus;use App::cpanminus::Dependency;use File::Basename ();use File::Find ();use File::Path ();use File::Spec ();use File::Copy ();use File::Temp ();use Getopt::Long ();use Symbol ();use String::ShellQuote ();use version ();use constant WIN32=>$^O eq 'MSWin32';use constant BAD_TAR=>($^O eq 'solaris' || $^O eq 'hpux');use constant CAN_SYMLINK=>eval {symlink("","");1};our$VERSION=$App::cpanminus::VERSION;if ($INC{"App/FatPacker/Trace.pm"}){require version::vpp}my$quote=WIN32 ? q/"/ : q/'/;sub agent {my$self=shift;my$agent="cpanminus/$VERSION";$agent .= " perl/$]" if$self->{report_perl_version};$agent}sub determine_home {my$class=shift;my$homedir=$ENV{HOME}|| eval {require File::HomeDir;File::HomeDir->my_home}|| join('',@ENV{qw(HOMEDRIVE HOMEPATH)});if (WIN32){require Win32;$homedir=Win32::GetShortPathName($homedir)}return "$homedir/.cpanm"}sub new {my$class=shift;bless {home=>$class->determine_home,cmd=>'install',seen=>{},notest=>undef,test_only=>undef,installdeps=>undef,force=>undef,sudo=>undef,make=>undef,verbose=>undef,quiet=>undef,interactive=>undef,log=>undef,mirrors=>[],mirror_only=>undef,mirror_index=>undef,cpanmetadb=>"http://cpanmetadb.plackperl.org/v1.0/",perl=>$^X,argv=>[],local_lib=>undef,self_contained=>undef,exclude_vendor=>undef,prompt_timeout=>0,prompt=>undef,configure_timeout=>60,build_timeout=>3600,test_timeout=>1800,try_lwp=>1,try_wget=>1,try_curl=>1,uninstall_shadows=>($] < 5.012),skip_installed=>1,skip_satisfied=>0,auto_cleanup=>7,pod2man=>1,installed_dists=>0,install_types=>['requires'],with_develop=>0,with_configure=>0,showdeps=>0,scandeps=>0,scandeps_tree=>[],format=>'tree',save_dists=>undef,skip_configure=>0,verify=>0,report_perl_version=>!$class->maybe_ci,build_args=>{},features=>{},pure_perl=>0,cpanfile_path=>'cpanfile',@_,},$class}sub env {my($self,$key)=@_;$ENV{"PERL_CPANM_" .$key}}sub maybe_ci {my$class=shift;grep$ENV{$_},qw(TRAVIS CI AUTOMATED_TESTING AUTHOR_TESTING)}sub install_type_handlers {my$self=shift;my@handlers;for my$type (qw(recommends suggests)){push@handlers,"with-$type"=>sub {my%uniq;$self->{install_types}=[grep!$uniq{$_}++,@{$self->{install_types}},$type ]};push@handlers,"without-$type"=>sub {$self->{install_types}=[grep $_ ne $type,@{$self->{install_types}}]}}@handlers}sub build_args_handlers {my$self=shift;my@handlers;for my$phase (qw(configure build test install)){push@handlers,"$phase-args=s"=>\($self->{build_args}{$phase})}@handlers}sub parse_options {my$self=shift;local@ARGV=@{$self->{argv}};push@ARGV,grep length,split /\s+/,$self->env('OPT');push@ARGV,@_;Getopt::Long::Configure("bundling");Getopt::Long::GetOptions('f|force'=>sub {$self->{skip_installed}=0;$self->{force}=1},'n|notest!'=>\$self->{notest},'test-only'=>sub {$self->{notest}=0;$self->{skip_installed}=0;$self->{test_only}=1},'S|sudo!'=>\$self->{sudo},'v|verbose'=>\$self->{verbose},'verify!'=>\$self->{verify},'q|quiet!'=>\$self->{quiet},'h|help'=>sub {$self->{action}='show_help'},'V|version'=>sub {$self->{action}='show_version'},'perl=s'=>sub {$self->diag("--perl is deprecated since it's known to be fragile in figuring out dependencies. Run `$_[1] -S cpanm` instead.\n",1);$self->{perl}=$_[1]},'l|local-lib=s'=>sub {$self->{local_lib}=$self->maybe_abs($_[1])},'L|local-lib-contained=s'=>sub {$self->{local_lib}=$self->maybe_abs($_[1]);$self->{self_contained}=1;$self->{pod2man}=undef},'self-contained!'=>\$self->{self_contained},'exclude-vendor!'=>\$self->{exclude_vendor},'mirror=s@'=>$self->{mirrors},'mirror-only!'=>\$self->{mirror_only},'mirror-index=s'=>sub {$self->{mirror_index}=$self->maybe_abs($_[1])},'M|from=s'=>sub {$self->{mirrors}=[$_[1]];$self->{mirror_only}=1},'cpanmetadb=s'=>\$self->{cpanmetadb},'cascade-search!'=>\$self->{cascade_search},'prompt!'=>\$self->{prompt},'installdeps'=>\$self->{installdeps},'skip-installed!'=>\$self->{skip_installed},'skip-satisfied!'=>\$self->{skip_satisfied},'reinstall'=>sub {$self->{skip_installed}=0},'interactive!'=>\$self->{interactive},'i|install'=>sub {$self->{cmd}='install'},'info'=>sub {$self->{cmd}='info'},'look'=>sub {$self->{cmd}='look';$self->{skip_installed}=0},'U|uninstall'=>sub {$self->{cmd}='uninstall'},'self-upgrade'=>sub {$self->{action}='self_upgrade'},'uninst-shadows!'=>\$self->{uninstall_shadows},'lwp!'=>\$self->{try_lwp},'wget!'=>\$self->{try_wget},'curl!'=>\$self->{try_curl},'auto-cleanup=s'=>\$self->{auto_cleanup},'man-pages!'=>\$self->{pod2man},'scandeps'=>\$self->{scandeps},'showdeps'=>sub {$self->{showdeps}=1;$self->{skip_installed}=0},'format=s'=>\$self->{format},'save-dists=s'=>sub {$self->{save_dists}=$self->maybe_abs($_[1])},'skip-configure!'=>\$self->{skip_configure},'dev!'=>\$self->{dev_release},'metacpan!'=>\$self->{metacpan},'report-perl-version!'=>\$self->{report_perl_version},'configure-timeout=i'=>\$self->{configure_timeout},'build-timeout=i'=>\$self->{build_timeout},'test-timeout=i'=>\$self->{test_timeout},'with-develop'=>\$self->{with_develop},'without-develop'=>sub {$self->{with_develop}=0},'with-configure'=>\$self->{with_configure},'without-configure'=>sub {$self->{with_configure}=0},'with-feature=s'=>sub {$self->{features}{$_[1]}=1},'without-feature=s'=>sub {$self->{features}{$_[1]}=0},'with-all-features'=>sub {$self->{features}{__all}=1},'pp|pureperl!'=>\$self->{pure_perl},"cpanfile=s"=>\$self->{cpanfile_path},$self->install_type_handlers,$self->build_args_handlers,);if (!@ARGV && $0 ne '-' &&!-t STDIN){push@ARGV,$self->load_argv_from_fh(\*STDIN);$self->{load_from_stdin}=1}$self->{argv}=\@ARGV}sub check_upgrade {my$self=shift;my$install_base=$ENV{PERL_LOCAL_LIB_ROOT}? $self->local_lib_target($ENV{PERL_LOCAL_LIB_ROOT}): $Config{installsitebin};if ($0 eq '-'){return}elsif ($0 !~ /^$install_base/){if ($0 =~ m!perlbrew/bin!){die <<DIE}else {die <<DIE}}}sub check_libs {my$self=shift;return if$self->{_checked}++;$self->bootstrap_local_lib}sub setup_verify {my$self=shift;my$has_modules=eval {require Module::Signature;require Digest::SHA;1};$self->{cpansign}=$self->which('cpansign');unless ($has_modules && $self->{cpansign}){warn "WARNING: Module::Signature and Digest::SHA is required for distribution verifications.\n";$self->{verify}=0}}sub parse_module_args {my($self,$module)=@_;$module =~ s/^([A-Za-z0-9_:]+)@([v\d\._]+)$/$1~== $2/;if ($module =~ /\~[v\d\._,\!<>= ]+$/){return split /\~/,$module,2}else {return$module,undef}}sub doit {my$self=shift;my$code;eval {$code=($self->_doit==0)};if (my$e=$@){warn$e;$code=1}return$code}sub _doit {my$self=shift;$self->setup_home;$self->init_tools;$self->setup_verify if$self->{verify};if (my$action=$self->{action}){$self->$action()and return 1}return$self->show_help(1)unless @{$self->{argv}}or $self->{load_from_stdin};$self->configure_mirrors;my$cwd=Cwd::cwd;my@fail;for my$module (@{$self->{argv}}){if ($module =~ s/\.pm$//i){my ($volume,$dirs,$file)=File::Spec->splitpath($module);$module=join '::',grep {$_}File::Spec->splitdir($dirs),$file}($module,my$version)=$self->parse_module_args($module);$self->chdir($cwd);if ($self->{cmd}eq 'uninstall'){$self->uninstall_module($module)or push@fail,$module}else {$self->install_module($module,0,$version)or push@fail,$module}}if ($self->{base}&& $self->{auto_cleanup}){$self->cleanup_workdirs}if ($self->{installed_dists}){my$dists=$self->{installed_dists}> 1 ? "distributions" : "distribution";$self->diag("$self->{installed_dists} $dists installed\n",1)}if ($self->{scandeps}){$self->dump_scandeps()}$self->chdir($cwd);return!@fail}sub setup_home {my$self=shift;$self->{home}=$self->env('HOME')if$self->env('HOME');unless (_writable($self->{home})){die "Can't write to cpanm home '$self->{home}': You should fix it with chown/chmod first.\n"}$self->{base}="$self->{home}/work/" .time .".$$";File::Path::mkpath([$self->{base}],0,0777);$self->{log}=File::Spec->catfile($self->{base},"build.log");my$final_log="$self->{home}/build.log";{open my$out,">$self->{log}" or die "$self->{log}: $!"}if (CAN_SYMLINK){my$build_link="$self->{home}/latest-build";unlink$build_link;symlink$self->{base},$build_link;unlink$final_log;symlink$self->{log},$final_log}else {my$log=$self->{log};my$home=$self->{home};$self->{at_exit}=sub {my$self=shift;my$temp_log="$home/build.log." .time .".$$";File::Copy::copy($log,$temp_log)&& unlink($final_log);rename($temp_log,$final_log)}}$self->chat("cpanm (App::cpanminus) $VERSION on perl $] built for $Config{archname}\n" ."Work directory is $self->{base}\n")}sub package_index_for {my ($self,$mirror)=@_;return$self->source_for($mirror)."/02packages.details.txt"}sub generate_mirror_index {my ($self,$mirror)=@_;my$file=$self->package_index_for($mirror);my$gz_file=$file .'.gz';my$index_mtime=(stat$gz_file)[9];unless (-e $file && (stat$file)[9]>= $index_mtime){$self->chat("Uncompressing index file...\n");if (eval {require Compress::Zlib}){my$gz=Compress::Zlib::gzopen($gz_file,"rb")or do {$self->diag_fail("$Compress::Zlib::gzerrno opening compressed index");return};open my$fh,'>',$file or do {$self->diag_fail("$! opening uncompressed index for write");return};my$buffer;while (my$status=$gz->gzread($buffer)){if ($status < 0){$self->diag_fail($gz->gzerror ." reading compressed index");return}print$fh $buffer}}else {if (system("gunzip -c $gz_file > $file")){$self->diag_fail("Cannot uncompress -- please install gunzip or Compress::Zlib");return}}utime$index_mtime,$index_mtime,$file}return 1}sub search_mirror_index {my ($self,$mirror,$module,$version)=@_;$self->search_mirror_index_file($self->package_index_for($mirror),$module,$version)}sub search_mirror_index_file {my($self,$file,$module,$version)=@_;open my$fh,'<',$file or return;my$found;while (<$fh>){if (m!^\Q$module\E\s+([\w\.]+)\s+(\S*)!m){$found=$self->cpan_module($module,$2,$1);last}}return$found unless$self->{cascade_search};if ($found){if ($self->satisfy_version($module,$found->{module_version},$version)){return$found}else {$self->chat("Found $module $found->{module_version} which doesn't satisfy $version.\n")}}return}sub with_version_range {my($self,$version)=@_;defined($version)&& $version =~ /(?:<|!=|==)/}sub encode_json {my($self,$data)=@_;require JSON::PP;my$json=JSON::PP::encode_json($data);$self->uri_escape($json)}sub decode_json {my($self,$json)=@_;require JSON::PP;JSON::PP::decode_json($json)}sub uri_escape {my($self,$fragment)=@_;$fragment =~ s/([^A-Za-z0-9\-\._~])/uc sprintf("%%%02X", ord($1))/eg;$fragment}sub uri_params {my($self,@params)=@_;my@param_strings;while (my$key=shift@params){my$value=shift@params;push@param_strings,join '=',map$self->uri_escape($_),$key,$value}return join '&',@param_strings}sub numify_ver {my($self,$ver)=@_;eval version->new($ver)->numify}sub search_metacpan {my($self,$module,$version,$dev_release)=@_;my$metacpan_uri='http://fastapi.metacpan.org/v1/download_url/';my$url=$metacpan_uri .$module;my$query=$self->uri_params(($version ? (version=>$version): ()),($dev_release ? (dev=>1): ()),);$url .= '?' .$query if length$query;my$dist_json=$self->get($url);my$dist_meta=eval {$self->decode_json($dist_json)};if ($dist_meta && $dist_meta->{download_url}){(my$distfile=$dist_meta->{download_url})=~ s!.+/authors/id/!!;local$self->{mirrors}=$self->{mirrors};$self->{mirrors}=['http://cpan.metacpan.org' ];return$self->cpan_module($module,$distfile,$dist_meta->{version})}$self->chat("! Could not find a release matching $module".($version?" ($version)":'')." on MetaCPAN.\n");return}sub search_database {my($self,$module,$version)=@_;my$found;if ($self->{dev_release}or $self->{metacpan}){$found=$self->search_metacpan($module,$version,$self->{dev_release})and return$found;$found=$self->search_cpanmetadb($module,$version,$self->{dev_release})and return$found}else {$found=$self->search_cpanmetadb($module,$version)and return$found;$found=$self->search_metacpan($module,$version)and return$found}}sub search_cpanmetadb {my($self,$module,$version,$dev_release)=@_;$self->chat("Searching $module ($version) on cpanmetadb ...\n");if ($self->with_version_range($version)){return$self->search_cpanmetadb_history($module,$version,$dev_release)}else {return$self->search_cpanmetadb_package($module,$version,$dev_release)}}sub search_cpanmetadb_package {my($self,$module,$version,$dev_release)=@_;require CPAN::Meta::YAML;(my$uri=$self->{cpanmetadb})=~ s{/?$}{/package/$module};my$yaml=$self->get($uri);my$meta=eval {CPAN::Meta::YAML::Load($yaml)};if ($meta && $meta->{distfile}){return$self->cpan_module($module,$meta->{distfile},$meta->{version})}$self->diag_fail("Finding $module on cpanmetadb failed.");return}sub search_cpanmetadb_history {my($self,$module,$version)=@_;(my$uri=$self->{cpanmetadb})=~ s{/?$}{/history/$module};my$content=$self->get($uri)or return;my@found;for my$line (split /\r?\n/,$content){if ($line =~ /^$module\s+(\S+)\s+(\S+)$/){push@found,{version=>$1,version_obj=>version::->parse($1),distfile=>$2,}}}return unless@found;$found[-1]->{latest}=1;my$match;for my$try (sort {$b->{version_obj}cmp $a->{version_obj}}@found){if ($self->satisfy_version($module,$try->{version_obj},$version)){local$self->{mirrors}=$self->{mirrors};unshift @{$self->{mirrors}},'http://backpan.perl.org' unless$try->{latest};return$self->cpan_module($module,$try->{distfile},$try->{version})}}$self->diag_fail("Finding $module ($version) on cpanmetadb failed.");return}sub search_module {my($self,$module,$version)=@_;if ($self->{mirror_index}){$self->mask_output(chat=>"Searching $module on mirror index $self->{mirror_index} ...\n");my$pkg=$self->search_mirror_index_file($self->{mirror_index},$module,$version);return$pkg if$pkg;unless ($self->{cascade_search}){$self->mask_output(diag_fail=>"Finding $module ($version) on mirror index $self->{mirror_index} failed.");return}}unless ($self->{mirror_only}){my$found=$self->search_database($module,$version);return$found if$found}MIRROR: for my$mirror (@{$self->{mirrors}}){$self->mask_output(chat=>"Searching $module on mirror $mirror ...\n");my$name='02packages.details.txt.gz';my$uri="$mirror/modules/$name";my$gz_file=$self->package_index_for($mirror).'.gz';unless ($self->{pkgs}{$uri}){$self->mask_output(chat=>"Downloading index file $uri ...\n");$self->mirror($uri,$gz_file);$self->generate_mirror_index($mirror)or next MIRROR;$self->{pkgs}{$uri}="!!retrieved!!"}my$pkg=$self->search_mirror_index($mirror,$module,$version);return$pkg if$pkg;$self->mask_output(diag_fail=>"Finding $module ($version) on mirror $mirror failed.")}return}sub source_for {my($self,$mirror)=@_;$mirror =~ s/[^\w\.\-]+/%/g;my$dir="$self->{home}/sources/$mirror";File::Path::mkpath([$dir ],0,0777);return$dir}sub load_argv_from_fh {my($self,$fh)=@_;my@argv;while(defined(my$line=<$fh>)){chomp$line;$line =~ s/#.+$//;$line =~ s/^\s+//;$line =~ s/\s+$//;push@argv,split ' ',$line if$line}return@argv}sub show_version {my$self=shift;print "cpanm (App::cpanminus) version $VERSION ($0)\n";print "perl version $] ($^X)\n\n";print " \%Config:\n";for my$key (qw(archname installsitelib installsitebin installman1dir installman3dir sitearchexp sitelibexp vendorarch vendorlibexp archlibexp privlibexp)){print " $key=$Config{$key}\n" if$Config{$key}}print " \%ENV:\n";for my$key (grep /^PERL/,sort keys%ENV){print " $key=$ENV{$key}\n"}print " \@INC:\n";for my$inc (@INC){print " $inc\n" unless ref($inc)eq 'CODE'}return 1}sub show_help {my$self=shift;if ($_[0]){print <<USAGE;return}print <<HELP;return 1}sub _writable {my$dir=shift;my@dir=File::Spec->splitdir($dir);while (@dir){$dir=File::Spec->catdir(@dir);if (-e $dir){return -w _}pop@dir}return}sub maybe_abs {my($self,$lib)=@_;if ($lib eq '_' or $lib =~ /^~/ or File::Spec->file_name_is_absolute($lib)){return$lib}else {return File::Spec->canonpath(File::Spec->catdir(Cwd::cwd(),$lib))}}sub local_lib_target {my($self,$root)=@_;(grep {$_ ne ''}split /\Q$Config{path_sep}/,$root)[0]}sub bootstrap_local_lib {my$self=shift;if ($self->{local_lib}){return$self->setup_local_lib($self->{local_lib})}if ($ENV{PERL_LOCAL_LIB_ROOT}&& $ENV{PERL_MM_OPT}){return$self->setup_local_lib($self->local_lib_target($ENV{PERL_LOCAL_LIB_ROOT}),1)}return if$self->{sudo}or (_writable($Config{installsitelib})and _writable($Config{installsitebin}));if ($ENV{PERL_MM_OPT}and ($ENV{MODULEBUILDRC}or $ENV{PERL_MB_OPT})){return}$self->setup_local_lib;$self->diag(<<DIAG,1);sleep 2}sub upgrade_toolchain {my($self,$config_deps)=@_;my%deps=map {$_->module=>$_}@$config_deps;my$reqs=CPAN::Meta::Requirements->from_string_hash({'Module::Build'=>'0.38','ExtUtils::MakeMaker'=>'6.58','ExtUtils::Install'=>'1.46',});if ($deps{"ExtUtils::MakeMaker"}){$deps{"ExtUtils::MakeMaker"}->merge_with($reqs)}elsif ($deps{"Module::Build"}){$deps{"Module::Build"}->merge_with($reqs);$deps{"ExtUtils::Install"}||= App::cpanminus::Dependency->new("ExtUtils::Install",0,'configure');$deps{"ExtUtils::Install"}->merge_with($reqs)}@$config_deps=values%deps}sub _core_only_inc {my($self,$base)=@_;require local::lib;(local::lib->resolve_path(local::lib->install_base_arch_path($base)),local::lib->resolve_path(local::lib->install_base_perl_path($base)),(!$self->{exclude_vendor}? grep {$_}@Config{qw(vendorarch vendorlibexp)}: ()),@Config{qw(archlibexp privlibexp)},)}sub _diff {my($self,$old,$new)=@_;my@diff;my%old=map {$_=>1}@$old;for my$n (@$new){push@diff,$n unless exists$old{$n}}@diff}sub _setup_local_lib_env {my($self,$base)=@_;$self->diag(<<WARN,1)if$base =~ /\s/;local$SIG{__WARN__}=sub {};local::lib->setup_env_hash_for($base,0)}sub setup_local_lib {my($self,$base,$no_env)=@_;$base=undef if$base eq '_';require local::lib;{local $0='cpanm';$base ||= "~/perl5";$base=local::lib->resolve_path($base);if ($self->{self_contained}){my@inc=$self->_core_only_inc($base);$self->{search_inc}=[@inc ]}else {$self->{search_inc}=[local::lib->install_base_arch_path($base),local::lib->install_base_perl_path($base),@INC,]}$self->_setup_local_lib_env($base)unless$no_env;$self->{local_lib}=$base}}sub prompt_bool {my($self,$mess,$def)=@_;my$val=$self->prompt($mess,$def);return lc$val eq 'y'}sub prompt {my($self,$mess,$def)=@_;my$isa_tty= -t STDIN && (-t STDOUT ||!(-f STDOUT || -c STDOUT));my$dispdef=defined$def ? "[$def] " : " ";$def=defined$def ? $def : "";if (!$self->{prompt}|| (!$isa_tty && eof STDIN)){return$def}local $|=1;local $\;my$ans;eval {local$SIG{ALRM}=sub {undef$ans;die "alarm\n"};print STDOUT "$mess $dispdef";alarm$self->{prompt_timeout}if$self->{prompt_timeout};$ans=<STDIN>;alarm 0};if (defined$ans){chomp$ans}else {print STDOUT "\n"}return (!defined$ans || $ans eq '')? $def : $ans}sub diag_ok {my($self,$msg)=@_;chomp$msg;$msg ||= "OK";if ($self->{in_progress}){$self->_diag("$msg\n");$self->{in_progress}=0}$self->log("-> $msg\n")}sub diag_fail {my($self,$msg,$always)=@_;chomp$msg;if ($self->{in_progress}){$self->_diag("FAIL\n");$self->{in_progress}=0}if ($msg){$self->_diag("! $msg\n",$always,1);$self->log("-> FAIL $msg\n")}}sub diag_progress {my($self,$msg)=@_;chomp$msg;$self->{in_progress}=1;$self->_diag("$msg ... ");$self->log("$msg\n")}sub _diag {my($self,$msg,$always,$error)=@_;my$fh=$error ? *STDERR : *STDOUT;print {$fh}$msg if$always or $self->{verbose}or!$self->{quiet}}sub diag {my($self,$msg,$always)=@_;$self->_diag($msg,$always);$self->log($msg)}sub chat {my$self=shift;print STDERR @_ if$self->{verbose};$self->log(@_)}sub mask_output {my$self=shift;my$method=shift;$self->$method($self->mask_uri_passwords(@_))}sub log {my$self=shift;open my$out,">>$self->{log}";print$out @_}sub run {my($self,$cmd)=@_;if (WIN32){$cmd=$self->shell_quote(@$cmd)if ref$cmd eq 'ARRAY';unless ($self->{verbose}){$cmd .= " >> " .$self->shell_quote($self->{log})." 2>&1"}!system$cmd}else {my$pid=fork;if ($pid){waitpid$pid,0;return!$?}else {$self->run_exec($cmd)}}}sub run_exec {my($self,$cmd)=@_;if (ref$cmd eq 'ARRAY'){unless ($self->{verbose}){open my$logfh,">>",$self->{log};open STDERR,'>&',$logfh;open STDOUT,'>&',$logfh;close$logfh}exec @$cmd}else {unless ($self->{verbose}){$cmd .= " >> " .$self->shell_quote($self->{log})." 2>&1"}exec$cmd}}sub run_timeout {my($self,$cmd,$timeout)=@_;return$self->run($cmd)if WIN32 || $self->{verbose}||!$timeout;my$pid=fork;if ($pid){eval {local$SIG{ALRM}=sub {die "alarm\n"};alarm$timeout;waitpid$pid,0;alarm 0};if ($@ && $@ eq "alarm\n"){$self->diag_fail("Timed out (> ${timeout}s). Use --verbose to retry.");local$SIG{TERM}='IGNORE';kill TERM=>0;waitpid$pid,0;return}return!$?}elsif ($pid==0){$self->run_exec($cmd)}else {$self->chat("! fork failed: falling back to system()\n");$self->run($cmd)}}sub append_args {my($self,$cmd,$phase)=@_;if (my$args=$self->{build_args}{$phase}){$cmd=join ' ',$self->shell_quote(@$cmd),$args}$cmd}sub configure {my($self,$cmd,$depth)=@_;local$ENV{PERL5_CPAN_IS_RUNNING}=local$ENV{PERL5_CPANPLUS_IS_RUNNING}=$$;local$ENV{PERL5_CPANM_IS_RUNNING}=$$;my$use_default=!$self->{interactive};local$ENV{PERL_MM_USE_DEFAULT}=$use_default;local$ENV{PERL_MM_OPT}=$ENV{PERL_MM_OPT};local$ENV{PERL_MB_OPT}=$ENV{PERL_MB_OPT};unless ($self->{pod2man}){$ENV{PERL_MM_OPT}.= " INSTALLMAN1DIR=none INSTALLMAN3DIR=none";$ENV{PERL_MB_OPT}.= " --config installman1dir= --config installsiteman1dir= --config installman3dir= --config installsiteman3dir="}if ($self->{pure_perl}){$ENV{PERL_MM_OPT}.= " PUREPERL_ONLY=1";$ENV{PERL_MB_OPT}.= " --pureperl-only"}local$ENV{PERL_USE_UNSAFE_INC}=1 unless exists$ENV{PERL_USE_UNSAFE_INC};$cmd=$self->append_args($cmd,'configure')if$depth==0;local$self->{verbose}=$self->{verbose}|| $self->{interactive};$self->run_timeout($cmd,$self->{configure_timeout})}sub build {my($self,$cmd,$distname,$depth)=@_;local$ENV{PERL_MM_USE_DEFAULT}=!$self->{interactive};local$ENV{PERL_USE_UNSAFE_INC}=1 unless exists$ENV{PERL_USE_UNSAFE_INC};$cmd=$self->append_args($cmd,'build')if$depth==0;return 1 if$self->run_timeout($cmd,$self->{build_timeout});while (1){my$ans=lc$self->prompt("Building $distname failed.\nYou can s)kip, r)etry, e)xamine build log, or l)ook ?","s");return if$ans eq 's';return$self->build($cmd,$distname,$depth)if$ans eq 'r';$self->show_build_log if$ans eq 'e';$self->look if$ans eq 'l'}}sub test {my($self,$cmd,$distname,$depth)=@_;return 1 if$self->{notest};local$ENV{PERL_MM_USE_DEFAULT}=!$self->{interactive};local$ENV{NONINTERACTIVE_TESTING}=!$self->{interactive};$cmd=$self->append_args($cmd,'test')if$depth==0;local$ENV{PERL_USE_UNSAFE_INC}=1 unless exists$ENV{PERL_USE_UNSAFE_INC};return 1 if$self->run_timeout($cmd,$self->{test_timeout});if ($self->{force}){$self->diag_fail("Testing $distname failed but installing it anyway.");return 1}else {$self->diag_fail;while (1){my$ans=lc$self->prompt("Testing $distname failed.\nYou can s)kip, r)etry, f)orce install, e)xamine build log, or l)ook ?","s");return if$ans eq 's';return$self->test($cmd,$distname,$depth)if$ans eq 'r';return 1 if$ans eq 'f';$self->show_build_log if$ans eq 'e';$self->look if$ans eq 'l'}}}sub install {my($self,$cmd,$uninst_opts,$depth)=@_;if ($depth==0 && $self->{test_only}){return 1}local$ENV{PERL_USE_UNSAFE_INC}=1 unless exists$ENV{PERL_USE_UNSAFE_INC};if ($self->{sudo}){unshift @$cmd,"sudo"}if ($self->{uninstall_shadows}&&!$ENV{PERL_MM_OPT}){push @$cmd,@$uninst_opts}$cmd=$self->append_args($cmd,'install')if$depth==0;$self->run($cmd)}sub look {my$self=shift;my$shell=$ENV{SHELL};$shell ||= $ENV{COMSPEC}if WIN32;if ($shell){my$cwd=Cwd::cwd;$self->diag("Entering $cwd with $shell\n");system$shell}else {$self->diag_fail("You don't seem to have a SHELL :/")}}sub show_build_log {my$self=shift;my@pagers=($ENV{PAGER},(WIN32 ? (): ('less')),'more');my$pager;while (@pagers){$pager=shift@pagers;next unless$pager;$pager=$self->which($pager);next unless$pager;last}if ($pager){system("$pager < $self->{log}")}else {$self->diag_fail("You don't seem to have a PAGER :/")}}sub chdir {my$self=shift;Cwd::chdir(File::Spec->canonpath($_[0]))or die "$_[0]: $!"}sub configure_mirrors {my$self=shift;unless (@{$self->{mirrors}}){$self->{mirrors}=['http://www.cpan.org' ]}for (@{$self->{mirrors}}){s!^/!file:///!;s!/$!!}}sub self_upgrade {my$self=shift;$self->check_upgrade;$self->{argv}=['App::cpanminus' ];return}sub install_module {my($self,$module,$depth,$version)=@_;$self->check_libs;if ($self->{seen}{$module}++){$self->chat("Already tried $module. Skipping.\n");return 1}if ($self->{skip_satisfied}){my($ok,$local)=$self->check_module($module,$version || 0);if ($ok){$self->diag("You have $module ($local)\n",1);return 1}}my$dist=$self->resolve_name($module,$version);unless ($dist){my$what=$module .($version ? " ($version)" : "");$self->diag_fail("Couldn't find module or a distribution $what",1);return}if ($dist->{distvname}&& $self->{seen}{$dist->{distvname}}++){$self->chat("Already tried $dist->{distvname}. Skipping.\n");return 1}if ($self->{cmd}eq 'info'){print$self->format_dist($dist),"\n";return 1}$dist->{depth}=$depth;if ($dist->{module}){unless ($self->satisfy_version($dist->{module},$dist->{module_version},$version)){$self->diag("Found $dist->{module} $dist->{module_version} which doesn't satisfy $version.\n",1);return}my$cmp=$version ? "==" : "";my$requirement=$dist->{module_version}? "$cmp$dist->{module_version}" : 0;my($ok,$local)=$self->check_module($dist->{module},$requirement);if ($self->{skip_installed}&& $ok){$self->diag("$dist->{module} is up to date. ($local)\n",1);return 1}}if ($dist->{dist}eq 'perl'){$self->diag("skipping $dist->{pathname}\n");return 1}$self->diag("--> Working on $module\n");$dist->{dir}||= $self->fetch_module($dist);unless ($dist->{dir}){$self->diag_fail("Failed to fetch distribution $dist->{distvname}",1);return}$self->chat("Entering $dist->{dir}\n");$self->chdir($self->{base});$self->chdir($dist->{dir});if ($self->{cmd}eq 'look'){$self->look;return 1}return$self->build_stuff($module,$dist,$depth)}sub uninstall_search_path {my$self=shift;$self->{local_lib}? (local::lib->install_base_arch_path($self->{local_lib}),local::lib->install_base_perl_path($self->{local_lib})): @Config{qw(installsitearch installsitelib)}}sub uninstall_module {my ($self,$module)=@_;$self->check_libs;my@inc=$self->uninstall_search_path;my($metadata,$packlist)=$self->packlists_containing($module,\@inc);unless ($packlist){$self->diag_fail(<<DIAG,1);return}my@uninst_files=$self->uninstall_target($metadata,$packlist);$self->ask_permission($module,\@uninst_files)or return;$self->uninstall_files(@uninst_files,$packlist);$self->diag("Successfully uninstalled $module\n",1);return 1}sub packlists_containing {my($self,$module,$inc)=@_;require Module::Metadata;my$metadata=Module::Metadata->new_from_module($module,inc=>$inc)or return;my$packlist;my$wanted=sub {return unless $_ eq '.packlist' && -f $_;for my$file ($self->unpack_packlist($File::Find::name)){$packlist ||= $File::Find::name if$file eq $metadata->filename}};{require File::pushd;my$pushd=File::pushd::pushd();my@search=grep -d $_,map File::Spec->catdir($_,'auto'),@$inc;File::Find::find($wanted,@search)}return$metadata,$packlist}sub uninstall_target {my($self,$metadata,$packlist)=@_;if ($self->has_shadow_install($metadata)or $self->{local_lib}){grep$self->should_unlink($_),$self->unpack_packlist($packlist)}else {$self->unpack_packlist($packlist)}}sub has_shadow_install {my($self,$metadata)=@_;my@shadow=grep defined,map Module::Metadata->new_from_module($metadata->name,inc=>[$_]),@INC;@shadow >= 2}sub should_unlink {my($self,$file)=@_;if ($self->{local_lib}){$file =~ /^\Q$self->{local_lib}\E/}else {!(grep$file =~ /^\Q$_\E/,@Config{qw(installbin installscript installman1dir installman3dir)})}}sub ask_permission {my ($self,$module,$files)=@_;$self->diag("$module contains the following files:\n\n");for my$file (@$files){$self->diag(" $file\n")}$self->diag("\n");return 'force uninstall' if$self->{force};local$self->{prompt}=1;return$self->prompt_bool("Are you sure you want to uninstall $module?",'y')}sub unpack_packlist {my ($self,$packlist)=@_;open my$fh,'<',$packlist or die "$packlist: $!";map {chomp;$_}<$fh>}sub uninstall_files {my ($self,@files)=@_;$self->diag("\n");for my$file (@files){$self->diag("Unlink: $file\n");unlink$file or $self->diag_fail("$!: $file")}$self->diag("\n");return 1}sub format_dist {my($self,$dist)=@_;return "$dist->{cpanid}/$dist->{filename}"}sub trim {local $_=shift;tr/\n/ /d;s/^\s*|\s*$//g;$_}sub fetch_module {my($self,$dist)=@_;$self->chdir($self->{base});for my$uri (@{$dist->{uris}}){$self->mask_output(diag_progress=>"Fetching $uri");my$filename=$dist->{filename}|| $uri;my$name=File::Basename::basename($filename);my$cancelled;my$fetch=sub {my$file;eval {local$SIG{INT}=sub {$cancelled=1;die "SIGINT\n"};$self->mirror($uri,$name);$file=$name if -e $name};$self->diag("ERROR: " .trim("$@")."\n",1)if $@ && $@ ne "SIGINT\n";return$file};my($try,$file);while ($try++ < 3){$file=$fetch->();last if$cancelled or $file;$self->mask_output(diag_fail=>"Download $uri failed. Retrying ... ")}if ($cancelled){$self->diag_fail("Download cancelled.");return}unless ($file){$self->mask_output(diag_fail=>"Failed to download $uri");next}$self->diag_ok;$dist->{local_path}=File::Spec->rel2abs($name);my$dir=$self->unpack($file,$uri,$dist);next unless$dir;if (my$save=$self->{save_dists}){my$path=$dist->{pathname}? "$save/authors/id/$dist->{pathname}" : "$save/vendor/$file";$self->chat("Copying $name to $path\n");File::Path::mkpath([File::Basename::dirname($path)],0,0777);File::Copy::copy($file,$path)or warn $!}return$dist,$dir}}sub unpack {my($self,$file,$uri,$dist)=@_;if ($self->{verify}){$self->verify_archive($file,$uri,$dist)or return}$self->chat("Unpacking $file\n");my$dir=$file =~ /\.zip/i ? $self->unzip($file): $self->untar($file);unless ($dir){$self->diag_fail("Failed to unpack $file: no directory")}return$dir}sub verify_archive {my($self,$file,$uri,$dist)=@_;unless ($dist->{cpanid}){$self->chat("Archive '$file' does not seem to be from PAUSE. Skip verification.\n");return 1}(my$mirror=$uri)=~ s!/authors/id.*$!!;(my$chksum_uri=$uri)=~ s!/[^/]*$!/CHECKSUMS!;my$chk_file=$self->source_for($mirror)."/$dist->{cpanid}.CHECKSUMS";$self->mask_output(diag_progress=>"Fetching $chksum_uri");$self->mirror($chksum_uri,$chk_file);unless (-e $chk_file){$self->diag_fail("Fetching $chksum_uri failed.\n");return}$self->diag_ok;$self->verify_checksum($file,$chk_file)}sub verify_checksum {my($self,$file,$chk_file)=@_;$self->chat("Verifying the SHA1 for $file\n");open my$fh,"<$chk_file" or die "$chk_file: $!";my$data=join '',<$fh>;$data =~ s/\015?\012/\n/g;require Safe;my$chksum=Safe->new->reval($data);if (!ref$chksum or ref$chksum ne 'HASH'){$self->diag_fail("! Checksum file downloaded from $chk_file is broken.\n");return}if (my$sha=$chksum->{$file}{sha256}){my$hex=$self->sha1_for($file);if ($hex eq $sha){$self->chat("Checksum for $file: Verified!\n")}else {$self->diag_fail("Checksum mismatch for $file\n");return}}else {$self->chat("Checksum for $file not found in CHECKSUMS.\n");return}}sub sha1_for {my($self,$file)=@_;require Digest::SHA;open my$fh,"<",$file or die "$file: $!";my$dg=Digest::SHA->new(256);my($data);while (read($fh,$data,4096)){$dg->add($data)}return$dg->hexdigest}sub verify_signature {my($self,$dist)=@_;$self->diag_progress("Verifying the SIGNATURE file");my$out=`$self->{cpansign} -v --skip 2>&1`;$self->log($out);if ($out =~ /Signature verified OK/){$self->diag_ok("Verified OK");return 1}else {$self->diag_fail("SIGNATURE verification for $dist->{filename} failed\n");return}}sub resolve_name {my($self,$module,$version)=@_;if ($module =~ /(?:^git:|\.git(?:@.+)?$)/){return$self->git_uri($module)}if ($module =~ /^(ftp|https?|file):/){if ($module =~ m!authors/id/(.*)!){return$self->cpan_dist($1,$module)}else {return {uris=>[$module ]}}}if ($module =~ m!^[\./]! && -d $module){return {source=>'local',dir=>Cwd::abs_path($module),}}if (-f $module){return {source=>'local',uris=>["file://" .Cwd::abs_path($module)],}}if ($module =~ s!^cpan:///distfile/!!){return$self->cpan_dist($module)}if ($module =~ m!^(?:[A-Z]/[A-Z]{2}/)?([A-Z]{2}[\-A-Z0-9]*/.*)$!){return$self->cpan_dist($1)}return$self->search_module($module,$version)}sub cpan_module {my($self,$module,$dist_file,$version)=@_;my$dist=$self->cpan_dist($dist_file);$dist->{module}=$module;$dist->{module_version}=$version if$version && $version ne 'undef';return$dist}sub cpan_dist {my($self,$dist,$url)=@_;$dist =~ s!^([A-Z]{2})!substr($1,0,1)."/".substr($1,0,2)."/".$1!e;require CPAN::DistnameInfo;my$d=CPAN::DistnameInfo->new($dist);if ($url){$url=[$url ]unless ref$url eq 'ARRAY'}else {my$id=$d->cpanid;my$fn=substr($id,0,1)."/" .substr($id,0,2)."/" .$id ."/" .$d->filename;my@mirrors=@{$self->{mirrors}};my@urls=map "$_/authors/id/$fn",@mirrors;$url=\@urls,}return {$d->properties,source=>'cpan',uris=>$url,}}sub git_uri {my ($self,$uri)=@_;($uri,my$commitish)=split /(?<=\.git)@/i,$uri,2;my$dir=File::Temp::tempdir(CLEANUP=>1);$self->mask_output(diag_progress=>"Cloning $uri");$self->run(['git','clone',$uri,$dir ]);unless (-e "$dir/.git"){$self->diag_fail("Failed cloning git repository $uri",1);return}if ($commitish){require File::pushd;my$dir=File::pushd::pushd($dir);unless ($self->run(['git','checkout',$commitish ])){$self->diag_fail("Failed to checkout '$commitish' in git repository $uri\n");return}}$self->diag_ok;return {source=>'local',dir=>$dir,}}sub setup_module_build_patch {my$self=shift;open my$out,">$self->{base}/ModuleBuildSkipMan.pm" or die $!;print$out <<EOF}sub core_version_for {my($self,$module)=@_;require Module::CoreList;unless (exists$Module::CoreList::version{$]+0}){die sprintf("Module::CoreList %s (loaded from %s) doesn't seem to have entries for perl $]. " ."You're strongly recommended to upgrade Module::CoreList from CPAN.\n",$Module::CoreList::VERSION,$INC{"Module/CoreList.pm"})}unless (exists$Module::CoreList::version{$]+0}{$module}){return -1}return$Module::CoreList::version{$]+0}{$module}}sub search_inc {my$self=shift;$self->{search_inc}||= do {if (defined$::Bin){[grep!/^\Q$::Bin\E\/..\/(?:fat)?lib$/,@INC]}else {[@INC]}}}sub check_module {my($self,$mod,$want_ver)=@_;require Module::Metadata;my$meta=Module::Metadata->new_from_module($mod,inc=>$self->search_inc)or return 0,undef;my$version=$meta->version;if ($self->{self_contained}&& $self->loaded_from_perl_lib($meta)){$version=$self->core_version_for($mod);return 0,undef if$version && $version==-1}$self->{local_versions}{$mod}=$version;if ($self->is_deprecated($meta)){return 0,$version}elsif ($self->satisfy_version($mod,$version,$want_ver)){return 1,($version || 'undef')}else {return 0,$version}}sub satisfy_version {my($self,$mod,$version,$want_ver)=@_;$want_ver='0' unless defined($want_ver)&& length($want_ver);require CPAN::Meta::Requirements;my$requirements=CPAN::Meta::Requirements->new;$requirements->add_string_requirement($mod,$want_ver);$requirements->accepts_module($mod,$version)}sub unsatisfy_how {my($self,$ver,$want_ver)=@_;if ($want_ver =~ /^[v0-9\.\_]+$/){return "$ver < $want_ver"}else {return "$ver doesn't satisfy $want_ver"}}sub is_deprecated {my($self,$meta)=@_;my$deprecated=eval {require Module::CoreList;Module::CoreList::is_deprecated($meta->{module})};return$deprecated && $self->loaded_from_perl_lib($meta)}sub loaded_from_perl_lib {my($self,$meta)=@_;require Config;my@dirs=qw(archlibexp privlibexp);if ($self->{self_contained}&&!$self->{exclude_vendor}&& $Config{vendorarch}){unshift@dirs,qw(vendorarch vendorlibexp)}for my$dir (@dirs){my$confdir=$Config{$dir};if ($confdir eq substr($meta->filename,0,length($confdir))){return 1}}return}sub should_install {my($self,$mod,$ver)=@_;$self->chat("Checking if you have $mod $ver ... ");my($ok,$local)=$self->check_module($mod,$ver);if ($ok){$self->chat("Yes ($local)\n")}elsif ($local){$self->chat("No (" .$self->unsatisfy_how($local,$ver).")\n")}else {$self->chat("No\n")}return$mod unless$ok;return}sub check_perl_version {my($self,$version)=@_;require CPAN::Meta::Requirements;my$req=CPAN::Meta::Requirements->from_string_hash({perl=>$version });$req->accepts_module(perl=>$])}sub install_deps {my($self,$dir,$depth,@deps)=@_;my(@install,%seen,@fail);for my$dep (@deps){next if$seen{$dep->module};if ($dep->module eq 'perl'){if ($dep->is_requirement &&!$self->check_perl_version($dep->version)){$self->diag("Needs perl @{[$dep->version]}, you have $]\n");push@fail,'perl'}}elsif ($self->should_install($dep->module,$dep->version)){push@install,$dep;$seen{$dep->module}=1}}if (@install){$self->diag("==> Found dependencies: " .join(", ",map $_->module,@install)."\n")}for my$dep (@install){$self->install_module($dep->module,$depth + 1,$dep->version)}$self->chdir($self->{base});$self->chdir($dir)if$dir;if ($self->{scandeps}){return 1}my@not_ok=$self->unsatisfied_deps(@deps);if (@not_ok){return 0,\@not_ok}else {return 1}}sub unsatisfied_deps {my($self,@deps)=@_;require CPAN::Meta::Check;require CPAN::Meta::Requirements;my$reqs=CPAN::Meta::Requirements->new;for my$dep (grep $_->is_requirement,@deps){$reqs->add_string_requirement($dep->module=>$dep->requires_version || '0')}my$ret=CPAN::Meta::Check::check_requirements($reqs,'requires',$self->{search_inc});grep defined,values %$ret}sub install_deps_bailout {my($self,$target,$dir,$depth,@deps)=@_;my($ok,$fail)=$self->install_deps($dir,$depth,@deps);if (!$ok){$self->diag_fail("Installing the dependencies failed: " .join(", ",@$fail),1);unless ($self->prompt_bool("Do you want to continue building $target anyway?","n")){$self->diag_fail("Bailing out the installation for $target.",1);return}}return 1}sub build_stuff {my($self,$stuff,$dist,$depth)=@_;if ($self->{verify}&& -e 'SIGNATURE'){$self->verify_signature($dist)or return}require CPAN::Meta;my($meta_file)=grep -f,qw(META.json META.yml);if ($meta_file){$self->chat("Checking configure dependencies from $meta_file\n");$dist->{cpanmeta}=eval {CPAN::Meta->load_file($meta_file)}}elsif ($dist->{dist}&& $dist->{version}){$self->chat("META.yml/json not found. Creating skeleton for it.\n");$dist->{cpanmeta}=CPAN::Meta->new({name=>$dist->{dist},version=>$dist->{version}})}$dist->{meta}=$dist->{cpanmeta}? $dist->{cpanmeta}->as_struct : {};my@config_deps;if ($dist->{cpanmeta}){push@config_deps,App::cpanminus::Dependency->from_prereqs($dist->{cpanmeta}->effective_prereqs,['configure'],$self->{install_types},)}if (-e 'Build.PL' &&!$self->should_use_mm($dist->{dist})&&!@config_deps){push@config_deps,App::cpanminus::Dependency->from_versions({'Module::Build'=>'0.38' },'configure',)}$self->merge_with_cpanfile($dist,\@config_deps);$self->upgrade_toolchain(\@config_deps);my$target=$dist->{meta}{name}? "$dist->{meta}{name}-$dist->{meta}{version}" : $dist->{dir};{$self->install_deps_bailout($target,$dist->{dir},$depth,@config_deps)or return}$self->diag_progress("Configuring $target");my$configure_state=$self->configure_this($dist,$depth);$self->diag_ok($configure_state->{configured_ok}? "OK" : "N/A");if ($dist->{cpanmeta}&& $dist->{source}eq 'cpan'){$dist->{provides}=$dist->{cpanmeta}{provides}|| $self->extract_packages($dist->{cpanmeta},".")}my$root_target=(($self->{installdeps}or $self->{showdeps})and $depth==0);$dist->{want_phases}=$self->{notest}&&!$root_target ? [qw(build runtime)]: [qw(build test runtime)];push @{$dist->{want_phases}},'develop' if$self->{with_develop}&& $depth==0;push @{$dist->{want_phases}},'configure' if$self->{with_configure}&& $depth==0;my@deps=$self->find_prereqs($dist);my$module_name=$self->find_module_name($configure_state)|| $dist->{meta}{name};$module_name =~ s/-/::/g;if ($self->{showdeps}){for my$dep (@config_deps,@deps){print$dep->module,($dep->version ? ("~".$dep->version): ""),"\n"}return 1}my$distname=$dist->{meta}{name}? "$dist->{meta}{name}-$dist->{meta}{version}" : $stuff;my$walkup;if ($self->{scandeps}){$walkup=$self->scandeps_append_child($dist)}$self->install_deps_bailout($distname,$dist->{dir},$depth,@deps)or return;if ($self->{scandeps}){unless ($configure_state->{configured_ok}){my$diag=<<DIAG;if (@config_deps){my@tree=@{$self->{scandeps_tree}};$diag .= "!\n" .join("",map "! * $_->[0]{module}\n",@tree[0..$#tree-1])if@tree}$self->diag("!\n$diag!\n",1)}$walkup->();return 1}if ($self->{installdeps}&& $depth==0){if ($configure_state->{configured_ok}){$self->diag("<== Installed dependencies for $stuff. Finishing.\n");return 1}else {$self->diag("! Configuring $distname failed. See $self->{log} for details.\n",1);return}}my$installed;if ($configure_state->{use_module_build}&& -e 'Build' && -f _){$self->diag_progress("Building " .($self->{notest}? "" : "and testing ").$distname);$self->build([$self->{perl},"./Build" ],$distname,$depth)&& $self->test([$self->{perl},"./Build","test" ],$distname,$depth)&& $self->install([$self->{perl},"./Build","install" ],["--uninst",1 ],$depth)&& $installed++}elsif ($self->{make}&& -e 'Makefile'){$self->diag_progress("Building " .($self->{notest}? "" : "and testing ").$distname);$self->build([$self->{make}],$distname,$depth)&& $self->test([$self->{make},"test" ],$distname,$depth)&& $self->install([$self->{make},"install" ],["UNINST=1" ],$depth)&& $installed++}else {my$why;my$configure_failed=$configure_state->{configured}&&!$configure_state->{configured_ok};if ($configure_failed){$why="Configure failed for $distname."}elsif ($self->{make}){$why="The distribution doesn't have a proper Makefile.PL/Build.PL"}else {$why="Can't configure the distribution. You probably need to have 'make'."}$self->diag_fail("$why See $self->{log} for details.",1);return}if ($installed && $self->{test_only}){$self->diag_ok;$self->diag("Successfully tested $distname\n",1)}elsif ($installed){my$local=$self->{local_versions}{$dist->{module}|| ''};my$version=$dist->{module_version}|| $dist->{meta}{version}|| $dist->{version};my$reinstall=$local && ($local eq $version);my$action=$local &&!$reinstall ? $self->numify_ver($version)< $self->numify_ver($local)? "downgraded" : "upgraded" : undef;my$how=$reinstall ? "reinstalled $distname" : $local ? "installed $distname ($action from $local)" : "installed $distname" ;my$msg="Successfully $how";$self->diag_ok;$self->diag("$msg\n",1);$self->{installed_dists}++;$self->save_meta($stuff,$dist,$module_name,\@config_deps,\@deps);return 1}else {my$what=$self->{test_only}? "Testing" : "Installing";$self->diag_fail("$what $stuff failed. See $self->{log} for details. Retry with --force to force install it.",1);return}}sub perl_requirements {my($self,@requires)=@_;my@perl;for my$requires (grep defined,@requires){if (exists$requires->{perl}){push@perl,App::cpanminus::Dependency->new(perl=>$requires->{perl})}}return@perl}sub should_use_mm {my($self,$dist)=@_;my%should_use_mm=map {$_=>1}qw(version ExtUtils-ParseXS ExtUtils-Install ExtUtils-Manifest);$should_use_mm{$dist}}sub configure_this {my($self,$dist,$depth)=@_;if (-e $self->{cpanfile_path}&& $self->{installdeps}&& $depth==0){require Module::CPANfile;$dist->{cpanfile}=eval {Module::CPANfile->load($self->{cpanfile_path})};$self->diag_fail($@,1)if $@;return {configured=>1,configured_ok=>!!$dist->{cpanfile},use_module_build=>0,}}if ($self->{skip_configure}){my$eumm= -e 'Makefile';my$mb= -e 'Build' && -f _;return {configured=>1,configured_ok=>$eumm || $mb,use_module_build=>$mb,}}my$state={};my$try_eumm=sub {if (-e 'Makefile.PL'){$self->chat("Running Makefile.PL\n");if ($self->configure([$self->{perl},"Makefile.PL" ],$depth)){$state->{configured_ok}= -e 'Makefile'}$state->{configured}++}};my$try_mb=sub {if (-e 'Build.PL'){$self->chat("Running Build.PL\n");if ($self->configure([$self->{perl},"Build.PL" ],$depth)){$state->{configured_ok}= -e 'Build' && -f _}$state->{use_module_build}++;$state->{configured}++}};my@try;if ($dist->{dist}&& $self->should_use_mm($dist->{dist})){@try=($try_eumm,$try_mb)}else {@try=($try_mb,$try_eumm)}for my$try (@try){$try->();last if$state->{configured_ok}}unless ($state->{configured_ok}){while (1){my$ans=lc$self->prompt("Configuring $dist->{dist} failed.\nYou can s)kip, r)etry, e)xamine build log, or l)ook ?","s");last if$ans eq 's';return$self->configure_this($dist,$depth)if$ans eq 'r';$self->show_build_log if$ans eq 'e';$self->look if$ans eq 'l'}}return$state}sub find_module_name {my($self,$state)=@_;return unless$state->{configured_ok};if ($state->{use_module_build}&& -e "_build/build_params"){my$params=do {open my$in,"_build/build_params";$self->safe_eval(join "",<$in>)};return eval {$params->[2]{module_name}}|| undef}elsif (-e "Makefile"){open my$mf,"Makefile";while (<$mf>){if (/^\#\s+NAME\s+=>\s+(.*)/){return$self->safe_eval($1)}}}return}sub list_files {my$self=shift;if (-e 'MANIFEST'){require ExtUtils::Manifest;my$manifest=eval {ExtUtils::Manifest::manifind()}|| {};return sort {lc$a cmp lc$b}keys %$manifest}else {require File::Find;my@files;my$finder=sub {my$name=$File::Find::name;$name =~ s!\.[/\\]!!;push@files,$name};File::Find::find($finder,".");return sort {lc$a cmp lc$b}@files}}sub extract_packages {my($self,$meta,$dir)=@_;my$try=sub {my$file=shift;return 0 if$file =~ m!^(?:x?t|inc|local|perl5|fatlib|_build)/!;return 1 unless$meta->{no_index};return 0 if grep {$file =~ m!^$_/!}@{$meta->{no_index}{directory}|| []};return 0 if grep {$file eq $_}@{$meta->{no_index}{file}|| []};return 1};require Parse::PMFile;my@files=grep {/\.pm(?:\.PL)?$/ && $try->($_)}$self->list_files;my$provides={};for my$file (@files){my$parser=Parse::PMFile->new($meta,{UNSAFE=>1,ALLOW_DEV_VERSION=>1 });my$packages=$parser->parse($file);while (my($package,$meta)=each %$packages){$provides->{$package}||= {file=>$meta->{infile},($meta->{version}eq 'undef')? (): (version=>$meta->{version}),}}}return$provides}sub save_meta {my($self,$module,$dist,$module_name,$config_deps,$build_deps)=@_;return unless$dist->{distvname}&& $dist->{source}eq 'cpan';my$base=($ENV{PERL_MM_OPT}|| '')=~ /INSTALL_BASE=/ ? ($self->install_base($ENV{PERL_MM_OPT})."/lib/perl5"): $Config{sitelibexp};my$provides=$dist->{provides};File::Path::mkpath("blib/meta",0,0777);my$local={name=>$module_name,target=>$module,version=>exists$provides->{$module_name}? ($provides->{$module_name}{version}|| $dist->{version}): $dist->{version},dist=>$dist->{distvname},pathname=>$dist->{pathname},provides=>$provides,};require JSON::PP;open my$fh,">","blib/meta/install.json" or die $!;print$fh JSON::PP::encode_json($local);if (-e "MYMETA.json"){File::Copy::copy("MYMETA.json","blib/meta/MYMETA.json")}my@cmd=(($self->{sudo}? 'sudo' : ()),$^X,'-MExtUtils::Install=install','-e',qq[install({ 'blib/meta' => '$base/$Config{archname}/.meta/$dist->{distvname}' })],);$self->run(\@cmd)}sub _merge_hashref {my($self,@hashrefs)=@_;my%hash;for my$h (@hashrefs){%hash=(%hash,%$h)}return \%hash}sub install_base {my($self,$mm_opt)=@_;$mm_opt =~ /INSTALL_BASE=(\S+)/ and return $1;die "Your PERL_MM_OPT doesn't contain INSTALL_BASE"}sub safe_eval {my($self,$code)=@_;eval$code}sub configure_features {my($self,$dist,@features)=@_;map $_->identifier,grep {$self->effective_feature($dist,$_)}@features}sub effective_feature {my($self,$dist,$feature)=@_;if ($dist->{depth}==0){my$value=$self->{features}{$feature->identifier};return$value if defined$value;return 1 if$self->{features}{__all}}if ($self->{interactive}){require CPAN::Meta::Requirements;$self->diag("[@{[ $feature->description ]}]\n",1);my$req=CPAN::Meta::Requirements->new;for my$phase (@{$dist->{want_phases}}){for my$type (@{$self->{install_types}}){$req->add_requirements($feature->prereqs->requirements_for($phase,$type))}}my$reqs=$req->as_string_hash;my@missing;for my$module (keys %$reqs){if ($self->should_install($module,$req->{$module})){push@missing,$module}}if (@missing){my$howmany=@missing;$self->diag("==> Found missing dependencies: " .join(", ",@missing)."\n",1);local$self->{prompt}=1;return$self->prompt_bool("Install the $howmany optional module(s)?","y")}}return}sub find_prereqs {my($self,$dist)=@_;my@deps=$self->extract_meta_prereqs($dist);if ($dist->{module}=~ /^Bundle::/i){push@deps,$self->bundle_deps($dist)}$self->merge_with_cpanfile($dist,\@deps);return@deps}sub merge_with_cpanfile {my($self,$dist,$deps)=@_;if ($self->{cpanfile_requirements}&&!$dist->{cpanfile}){for my$dep (@$deps){$dep->merge_with($self->{cpanfile_requirements})}}}sub extract_meta_prereqs {my($self,$dist)=@_;if ($dist->{cpanfile}){my@features=$self->configure_features($dist,$dist->{cpanfile}->features);my$prereqs=$dist->{cpanfile}->prereqs_with(@features);$self->{cpanfile_requirements}=$prereqs->merged_requirements($dist->{want_phases},['requires']);return App::cpanminus::Dependency->from_prereqs($prereqs,$dist->{want_phases},$self->{install_types})}require CPAN::Meta;my@deps;my($meta_file)=grep -f,qw(MYMETA.json MYMETA.yml);if ($meta_file){$self->chat("Checking dependencies from $meta_file ...\n");my$mymeta=eval {CPAN::Meta->load_file($meta_file,{lazy_validation=>1 })};if ($mymeta){$dist->{meta}{name}=$mymeta->name;$dist->{meta}{version}=$mymeta->version;return$self->extract_prereqs($mymeta,$dist)}}if (-e '_build/prereqs'){$self->chat("Checking dependencies from _build/prereqs ...\n");my$prereqs=do {open my$in,"_build/prereqs";$self->safe_eval(join "",<$in>)};my$meta=CPAN::Meta->new({name=>$dist->{meta}{name},version=>$dist->{meta}{version},%$prereqs },{lazy_validation=>1 },);@deps=$self->extract_prereqs($meta,$dist)}elsif (-e 'Makefile'){$self->chat("Finding PREREQ from Makefile ...\n");open my$mf,"Makefile";while (<$mf>){if (/^\#\s+PREREQ_PM => \{\s*(.*?)\s*\}/){my@all;my@pairs=split ', ',$1;for (@pairs){my ($pkg,$v)=split '=>',$_;push@all,[$pkg,$v ]}my$list=join ", ",map {"'$_->[0]' => $_->[1]"}@all;my$prereq=$self->safe_eval("no strict; +{ $list }");push@deps,App::cpanminus::Dependency->from_versions($prereq)if$prereq;last}}}return@deps}sub bundle_deps {my($self,$dist)=@_;my$match;if ($dist->{module}){$match=sub {my$meta=Module::Metadata->new_from_file($_[0]);$meta && ($meta->name eq $dist->{module})}}else {$match=sub {1}}my@files;File::Find::find({wanted=>sub {push@files,File::Spec->rel2abs($_)if /\.pm$/i && $match->($_)},no_chdir=>1,},'.');my@deps;for my$file (@files){open my$pod,"<",$file or next;my$in_contents;while (<$pod>){if (/^=head\d\s+CONTENTS/){$in_contents=1}elsif (/^=/){$in_contents=0}elsif ($in_contents){/^(\S+)\s*(\S+)?/ and push@deps,App::cpanminus::Dependency->new($1,$self->maybe_version($2))}}}return@deps}sub maybe_version {my($self,$string)=@_;return$string && $string =~ /^\.?\d/ ? $string : undef}sub extract_prereqs {my($self,$meta,$dist)=@_;my@features=$self->configure_features($dist,$meta->features);my$prereqs=$self->soften_makemaker_prereqs($meta->effective_prereqs(\@features)->clone);return App::cpanminus::Dependency->from_prereqs($prereqs,$dist->{want_phases},$self->{install_types})}sub soften_makemaker_prereqs {my($self,$prereqs)=@_;return$prereqs unless -e "inc/Module/Install.pm";for my$phase (qw(build test runtime)){my$reqs=$prereqs->requirements_for($phase,'requires');if ($reqs->requirements_for_module('ExtUtils::MakeMaker')){$reqs->clear_requirement('ExtUtils::MakeMaker');$reqs->add_minimum('ExtUtils::MakeMaker'=>0)}}$prereqs}sub cleanup_workdirs {my$self=shift;my$expire=time - 24 * 60 * 60 * $self->{auto_cleanup};my@targets;opendir my$dh,"$self->{home}/work";while (my$e=readdir$dh){next if$e !~ /^(\d+)\.\d+$/;my$time=$1;if ($time < $expire){push@targets,"$self->{home}/work/$e"}}if (@targets){if (@targets >= 64){$self->diag("Expiring " .scalar(@targets)." work directories. This might take a while...\n")}else {$self->chat("Expiring " .scalar(@targets)." work directories.\n")}File::Path::rmtree(\@targets,0,0)}}sub scandeps_append_child {my($self,$dist)=@_;my$new_node=[$dist,[]];my$curr_node=$self->{scandeps_current}|| [undef,$self->{scandeps_tree}];push @{$curr_node->[1]},$new_node;$self->{scandeps_current}=$new_node;return sub {$self->{scandeps_current}=$curr_node}}sub dump_scandeps {my$self=shift;if ($self->{format}eq 'tree'){$self->walk_down(sub {my($dist,$depth)=@_;if ($depth==0){print "$dist->{distvname}\n"}else {print " " x ($depth - 1);print "\\_ $dist->{distvname}\n"}},1)}elsif ($self->{format}=~ /^dists?$/){$self->walk_down(sub {my($dist,$depth)=@_;print$self->format_dist($dist),"\n"},0)}elsif ($self->{format}eq 'json'){require JSON::PP;print JSON::PP::encode_json($self->{scandeps_tree})}elsif ($self->{format}eq 'yaml'){require YAML;print YAML::Dump($self->{scandeps_tree})}else {$self->diag("Unknown format: $self->{format}\n")}}sub walk_down {my($self,$cb,$pre)=@_;$self->_do_walk_down($self->{scandeps_tree},$cb,0,$pre)}sub _do_walk_down {my($self,$children,$cb,$depth,$pre)=@_;for my$node (@$children){$cb->($node->[0],$depth)if$pre;$self->_do_walk_down($node->[1],$cb,$depth + 1,$pre);$cb->($node->[0],$depth)unless$pre}}sub DESTROY {my$self=shift;$self->{at_exit}->($self)if$self->{at_exit}}sub shell_quote {my($self,@stuff)=@_;if (WIN32){join ' ',map {/^${quote}.+${quote}$/ ? $_ : ($quote .$_ .$quote)}@stuff}else {String::ShellQuote::shell_quote_best_effort(@stuff)}}sub which {my($self,$name)=@_;if (File::Spec->file_name_is_absolute($name)){if (-x $name &&!-d _){return$name}}my$exe_ext=$Config{_exe};for my$dir (File::Spec->path){my$fullpath=File::Spec->catfile($dir,$name);if ((-x $fullpath || -x ($fullpath .= $exe_ext))&&!-d _){if ($fullpath =~ /\s/){$fullpath=$self->shell_quote($fullpath)}return$fullpath}}return}sub get {my($self,$uri)=@_;if ($uri =~ /^file:/){$self->file_get($uri)}else {$self->{_backends}{get}->(@_)}}sub mirror {my($self,$uri,$local)=@_;if ($uri =~ /^file:/){$self->file_mirror($uri,$local)}else {$self->{_backends}{mirror}->(@_)}}sub untar {$_[0]->{_backends}{untar}->(@_)};sub unzip {$_[0]->{_backends}{unzip}->(@_)};sub uri_to_file {my($self,$uri)=@_;if ($uri =~ s!file:/+!!){$uri="/$uri" unless$uri =~ m![a-zA-Z]:!}return$uri}sub file_get {my($self,$uri)=@_;my$file=$self->uri_to_file($uri);open my$fh,"<$file" or return;join '',<$fh>}sub file_mirror {my($self,$uri,$path)=@_;my$file=$self->uri_to_file($uri);my$source_mtime=(stat$file)[9];return 1 if -e $path && (stat$path)[9]>= $source_mtime;File::Copy::copy($file,$path);utime$source_mtime,$source_mtime,$path}sub has_working_lwp {my($self,$mirrors)=@_;my$https=grep /^https:/,@$mirrors;eval {require LWP::UserAgent;LWP::UserAgent->VERSION(5.802);require LWP::Protocol::https if$https;1}}sub init_tools {my$self=shift;return if$self->{initialized}++;if ($self->{make}=$self->which($Config{make})){$self->chat("You have make $self->{make}\n")}if ($self->{try_lwp}&& $self->has_working_lwp($self->{mirrors})){$self->chat("You have LWP $LWP::VERSION\n");my$ua=sub {LWP::UserAgent->new(parse_head=>0,env_proxy=>1,agent=>$self->agent,timeout=>30,@_,)};$self->{_backends}{get}=sub {my$self=shift;my$res=$ua->()->request(HTTP::Request->new(GET=>$_[0]));return unless$res->is_success;return$res->decoded_content};$self->{_backends}{mirror}=sub {my$self=shift;my$res=$ua->()->mirror(@_);die$res->content if$res->code==501;$res->code}}elsif ($self->{try_wget}and my$wget=$self->which('wget')){$self->chat("You have $wget\n");my@common=('--user-agent',$self->agent,'--retry-connrefused',($self->{verbose}? (): ('-q')),);$self->{_backends}{get}=sub {my($self,$uri)=@_;$self->safeexec(my$fh,$wget,$uri,@common,'-O','-')or die "wget $uri: $!";local $/;<$fh>};$self->{_backends}{mirror}=sub {my($self,$uri,$path)=@_;$self->safeexec(my$fh,$wget,$uri,@common,'-O',$path)or die "wget $uri: $!";local $/;<$fh>}}elsif ($self->{try_curl}and my$curl=$self->which('curl')){$self->chat("You have $curl\n");my@common=('--location','--user-agent',$self->agent,($self->{verbose}? (): '-s'),);$self->{_backends}{get}=sub {my($self,$uri)=@_;$self->safeexec(my$fh,$curl,@common,$uri)or die "curl $uri: $!";local $/;<$fh>};$self->{_backends}{mirror}=sub {my($self,$uri,$path)=@_;$self->safeexec(my$fh,$curl,@common,$uri,'-#','-o',$path)or die "curl $uri: $!";local $/;<$fh>}}else {require HTTP::Tiny;$self->chat("Falling back to HTTP::Tiny $HTTP::Tiny::VERSION\n");my%common=(agent=>$self->agent,);$self->{_backends}{get}=sub {my$self=shift;my$res=HTTP::Tiny->new(%common)->get($_[0]);return unless$res->{success};return$res->{content}};$self->{_backends}{mirror}=sub {my$self=shift;my$res=HTTP::Tiny->new(%common)->mirror(@_);return$res->{status}}}my$tar=$self->which('tar');my$tar_ver;my$maybe_bad_tar=sub {WIN32 || BAD_TAR || (($tar_ver=`$tar --version 2>/dev/null`)=~ /GNU.*1\.13/i)};if ($tar &&!$maybe_bad_tar->()){chomp$tar_ver;$self->chat("You have $tar: $tar_ver\n");$self->{_backends}{untar}=sub {my($self,$tarfile)=@_;my$xf=($self->{verbose}? 'v' : '')."xf";my$ar=$tarfile =~ /bz2$/ ? 'j' : 'z';my($root,@others)=`$tar ${ar}tf $tarfile` or return undef;FILE: {chomp$root;$root =~ s!^\./!!;$root =~ s{^(.+?)/.*$}{$1};if (!length($root)){$root=shift(@others);redo FILE if$root}}system "$tar $ar$xf $tarfile";return$root if -d $root;$self->diag_fail("Bad archive: $tarfile");return undef}}elsif ($tar and my$gzip=$self->which('gzip')and my$bzip2=$self->which('bzip2')){$self->chat("You have $tar, $gzip and $bzip2\n");$self->{_backends}{untar}=sub {my($self,$tarfile)=@_;my$x="x" .($self->{verbose}? 'v' : '')."f -";my$ar=$tarfile =~ /bz2$/ ? $bzip2 : $gzip;my($root,@others)=`$ar -dc $tarfile | $tar tf -` or return undef;FILE: {chomp$root;$root =~ s!^\./!!;$root =~ s{^(.+?)/.*$}{$1};if (!length($root)){$root=shift(@others);redo FILE if$root}}system "$ar -dc $tarfile | $tar $x";return$root if -d $root;$self->diag_fail("Bad archive: $tarfile");return undef}}elsif (eval {require Archive::Tar}){$self->chat("Falling back to Archive::Tar $Archive::Tar::VERSION\n");$self->{_backends}{untar}=sub {my$self=shift;my$t=Archive::Tar->new($_[0]);my($root,@others)=$t->list_files;FILE: {$root =~ s!^\./!!;$root =~ s{^(.+?)/.*$}{$1};if (!length($root)){$root=shift(@others);redo FILE if$root}}$t->extract;return -d $root ? $root : undef}}else {$self->{_backends}{untar}=sub {die "Failed to extract $_[1] - You need to have tar or Archive::Tar installed.\n"}}if (my$unzip=$self->which('unzip')){$self->chat("You have $unzip\n");$self->{_backends}{unzip}=sub {my($self,$zipfile)=@_;my$opt=$self->{verbose}? '' : '-q';my(undef,$root,@others)=`$unzip -t $zipfile` or return undef;FILE: {chomp$root;if ($root !~ s{^\s+testing:\s+([^/]+)/.*?\s+OK$}{$1}){$root=shift(@others);redo FILE if$root}}system "$unzip $opt $zipfile";return$root if -d $root;$self->diag_fail("Bad archive: [$root] $zipfile");return undef}}else {$self->{_backends}{unzip}=sub {eval {require Archive::Zip}or die "Failed to extract $_[1] - You need to have unzip or Archive::Zip installed.\n";my($self,$file)=@_;my$zip=Archive::Zip->new();my$status;$status=$zip->read($file);$self->diag_fail("Read of file[$file] failed")if$status!=Archive::Zip::AZ_OK();my@members=$zip->members();for my$member (@members){my$af=$member->fileName();next if ($af =~ m!^(/|\.\./)!);$status=$member->extractToFileNamed($af);$self->diag_fail("Extracting of file[$af] from zipfile[$file failed")if$status!=Archive::Zip::AZ_OK()}my ($root)=$zip->membersMatching(qr<^[^/]+/$>);$root &&= $root->fileName;return -d $root ? $root : undef}}}sub safeexec {my$self=shift;my$rdr=$_[0]||= Symbol::gensym();if (WIN32){my$cmd=$self->shell_quote(@_[1..$#_]);return open($rdr,"$cmd |")}if (my$pid=open($rdr,'-|')){return$pid}elsif (defined$pid){exec(@_[1 .. $#_ ]);exit 1}else {return}}sub mask_uri_passwords {my($self,@strings)=@_;s{ (https?://) ([^:/]+) : [^@/]+ @ }{$1$2:********@}gx for@strings;return@strings}1;
Subroutine BEGIN: called CC=1 SCAR=2.5
Subroutine BEGIN: called CC=1 SCAR=2.5
Subroutine BEGIN: called CC=1 SCAR=2.5
Subroutine BEGIN: called CC=1 SCAR=2.5
Subroutine BEGIN: called CC=1 SCAR=2.5
Subroutine BEGIN: called CC=1 SCAR=2.5
Subroutine BEGIN: called CC=1 SCAR=2.5
Subroutine BEGIN: called CC=1 SCAR=2.5
Subroutine BEGIN: called CC=1 SCAR=2.5
Subroutine BEGIN: called CC=1 SCAR=2.5
Subroutine BEGIN: called CC=1 SCAR=2.5
Subroutine BEGIN: called CC=1 SCAR=2.5
Subroutine BEGIN: called CC=1 SCAR=2.5
Subroutine BEGIN: called CC=1 SCAR=2.5
Subroutine BEGIN: called CC=1 SCAR=2.5
Subroutine BEGIN: called CC=1 SCAR=2.5
Subroutine BEGIN: called CC=2 SCAR=11.3
Subroutine BEGIN: called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=1 SCAR=2.5
Subroutine __ANON__: not called CC=2 SCAR=11.3
Subroutine _doit: called CC=16 SCAR=44.7
Subroutine agent: not called CC=2 SCAR=11.3
Subroutine build_args_handlers: called CC=2 SCAR=11.3
Subroutine check_libs: not called CC=2 SCAR=11.3
Subroutine check_upgrade: not called CC=5 SCAR=24.8
Subroutine decode_json: not called CC=1 SCAR=2.5
Subroutine determine_home: called CC=3 SCAR=17.0
Subroutine doit: called CC=2 SCAR=11.3
Subroutine encode_json: not called CC=1 SCAR=2.5
Subroutine env: called CC=1 SCAR=2.5
Subroutine generate_mirror_index: not called CC=9 SCAR=34.5
Subroutine install_type_handlers: called CC=2 SCAR=11.3
Subroutine maybe_ci: called CC=1 SCAR=2.5
Subroutine new: called CC=1 SCAR=2.5
Subroutine package_index_for: not called CC=1 SCAR=2.5
Subroutine parse_module_args: not called CC=2 SCAR=11.3
Subroutine parse_options: called CC=4 SCAR=21.3
Subroutine search_mirror_index: not called CC=1 SCAR=2.5
Subroutine search_mirror_index_file: not called CC=7 SCAR=30.3
Subroutine setup_home: called CC=4 SCAR=21.3
Subroutine setup_verify: not called CC=3 SCAR=17.0
Subroutine uri_escape: not called CC=1 SCAR=5.2
Subroutine with_version_range: not called CC=2 SCAR=11.3
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Branch: 40 branches
BranchTrueFalseTotal
File::Copy::copy($log, $temp_log) and unlink $final_log 0 0 0
if $self->{"verify"} 0 2 2
if (my $action = $self->{"action"}) 2 0 2
$self->$action and return 1 2 0 2
unless @{$self->{"argv"};} or $self->{"load_from_stdin"} 0 0 0
if ($module =~ s/\.pm$//i) 0 0 0
if ($self->{'cmd'} eq 'uninstall') { } 0 0 0
$self->uninstall_module($module) or push @fail, $module 0 0 0
$self->install_module($module, 0, $version) or push @fail, $module 0 0 0
if ($self->{"base"} and $self->{"auto_cleanup"}) 0 0 0
if ($self->{"installed_dists"}) 0 0 0
$self->{'installed_dists'} > 1 ? : 0 0 0
if ($self->{"scandeps"}) 0 0 0
if $self->{"report_perl_version"} 0 0 0
if $self->{"_checked"}++ 0 0 0
$ENV{'PERL_LOCAL_LIB_ROOT'} ? : 0 0 0
if ($0 eq '-') { } 0 0 0
elsif (not $0 =~ /^$install_base/) { } 0 0 0
if ($0 =~ m[perlbrew/bin]) { } 0 0 0
if (my $e = $@) 0 2 2
unless (-e $file and (stat $file)[9] >= $index_mtime) 0 0 0
if (eval { do { require Compress::Zlib } }) { } 0 0 0
my $gz = Compress::Zlib::gzopen($gz_file, "rb") or do { $self->diag_fail("$Compress::Zlib::gzerrno opening compressed index"); return } 0 0 0
open my $fh, ">", $file or do { $self->diag_fail("$! opening uncompressed index for write"); return } 0 0 0
if (my $status = $gz->gzread($buffer)) 0 0 0
if ($status < 0) 0 0 0
if (system "gunzip -c $gz_file > $file") 0 0 0
if ($module =~ /\~[v\d\._,\!<>= ]+$/) { } 0 0 0
if (not @ARGV and $0 ne "-" and not -t STDIN) 2 0 2
open my $fh, "<", $file or return 0 0 0
if (defined($_ = readline $fh)) 0 0 0
if (/^\Q$module\E\s+([\w\.]+)\s+(\S*)/m) 0 0 0
unless $self->{"cascade_search"} 0 0 0
if ($found) 0 0 0
if ($self->satisfy_version($module, $found->{'module_version'}, $version)) { } 0 0 0
if $self->env("HOME") 2 0 2
unless (_writable($self->{"home"})) 0 2 2
open my $out, qq[>$self->{"log"}] or die qq[$self->{"log"}: $!] 2 0 2
unless ($has_modules and $self->{"cpansign"}) 0 0 0
defined $version and $version =~ /(?:<|!=|==)/ 0 0 0
Condition18%5/27
$^O eq 'solaris' || $^O eq 'hpux'
l!l&&r!l&&!r
002
@{$self->{"argv"};} or $self->{"load_from_stdin"}
l!l&&r!l&&!r
000
$self->{"base"} and $self->{"auto_cleanup"}
!ll&&!rl&&r
000
$ENV{'HOME'} || eval { do { require File::HomeDir; 'File::HomeDir'->my_home } } || join('', @ENV{'HOMEDRIVE', 'HOMEPATH'})
l!l&&r!l&&!r
200
$ENV{"HOME"} or eval { do { require File::HomeDir; "File::HomeDir"->my_home } }
l!l&&r!l&&!r
200
-e $file and (stat $file)[9] >= $index_mtime
!ll&&!rl&&r
000
not @ARGV and $0 ne "-" and not -t STDIN
!ll&&!rl&&r
002
not @ARGV and $0 ne "-"
!ll&&!rl&&r
002
$has_modules and $self->{"cpansign"}
!ll&&!rl&&r
000
MC/DC0%0/2
$^O eq 'solaris' || $^O eq 'hpux'
$^O eq 'solaris' $^O eq 'hpux'
MC/DC0%0/2
@{$self->{"argv"};} or $self->{"load_from_stdin"}
@{$self->{"argv"};} $self->{"load_from_stdin"}
MC/DC0%0/2
$self->{"base"} and $self->{"auto_cleanup"}
$self->{"base"} $self->{"auto_cleanup"}
MC/DC0%0/3
$ENV{'HOME'} || eval { do { require File::HomeDir; 'File::HomeDir'->my_home } } || join('', @ENV{'HOMEDRIVE', 'HOMEPATH'})
$ENV{"HOME"} eval { do { require File::HomeDir; "File::HomeDir"->my_home } } join('', @ENV{'HOMEDRIVE', 'HOMEPATH'})
MC/DC0%0/2
-e $file and (stat $file)[9] >= $index_mtime
-e $file (stat $file)[9] >= $index_mtime
MC/DC0%0/3
not @ARGV and $0 ne "-" and not -t STDIN
not @ARGV $0 ne "-" not -t STDIN
MC/DC0%0/2
$has_modules and $self->{"cpansign"}
$has_modules $self->{"cpansign"}
Truth table33%1/3
A || B
A= $^O eq 'solaris'B= $^O eq 'hpux'
ABresult
1X1
011
000
Truth table0%0/3
A or B
A= @{$self->{"argv"};}B= $self->{"load_from_stdin"}
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= $self->{"base"}B= $self->{"auto_cleanup"}
ABresult
0X0
100
111
Truth table25%1/4
A or B || C
A= $ENV{"HOME"}B= eval { do { require File::HomeDir; "File::HomeDir"->my_home } }C= join('', @ENV{'HOMEDRIVE', 'HOMEPATH'})
ABCresult
1XX1
01X1
0011
0000
Truth table0%0/3
A and B
A= -e $fileB= (stat $file)[9] >= $index_mtime
ABresult
0X0
100
111
Truth table25%1/4
not(A) and B and not(C)
A= not @ARGVB= $0 ne "-"C= not -t STDIN
ABCresult
0XX0
10X0
1100
1111
Truth table0%0/3
A and B
A= $has_modulesB= $self->{"cpansign"}
ABresult
0X0
100
111
33 It appears your cpanm executable was installed via `perlbrew install-cpanm`.
34 cpanm --self-upgrade won't upgrade the version of cpanm you're running.
35
36 Run the following command to get it upgraded.
37
38 perlbrew install-cpanm
39
40 DIE
41 You are running cpanm from the path where your current perl won't install executables to.
42 Because of that, cpanm --self-upgrade won't upgrade the version of cpanm you're running.
43
44 cpanm path : $0
45 Install path : $Config{installsitebin}
46
47 It means you either installed cpanm globally with system perl, or use distro packages such
48 as rpm or apt-get, and you have to use them again to upgrade cpanm.
49 0 ▶ DIE
Subroutine __ANON__: not called CC=1 SCAR=6.4
Subroutine __ANON__: not called CC=1 SCAR=6.4
Subroutine __ANON__: not called CC=1 SCAR=6.4
Subroutine __ANON__: not called CC=6 SCAR=36.5
Subroutine __ANON__: not called CC=4 SCAR=29.1
Subroutine __ANON__: not called CC=1 SCAR=6.4
Subroutine _core_only_inc: not called CC=2 SCAR=17.2
Subroutine _diag: not called CC=5 SCAR=33.1
Subroutine _diff: not called CC=3 SCAR=24.1
Subroutine _setup_local_lib_env: not called CC=2 SCAR=17.2
Subroutine _writable: called CC=3 SCAR=24.1
Subroutine append_args: not called CC=2 SCAR=17.2
Subroutine ask_permission: not called CC=3 SCAR=24.1
Subroutine bootstrap_local_lib: not called CC=10 SCAR=46.0
Subroutine build: not called CC=8 SCAR=41.8
Subroutine chat: called CC=2 SCAR=17.2
Subroutine chdir: not called CC=2 SCAR=17.2
Subroutine configure: not called CC=6 SCAR=36.5
Subroutine configure_mirrors: not called CC=3 SCAR=24.1
Subroutine cpan_dist: not called CC=3 SCAR=24.0
Subroutine cpan_module: not called CC=3 SCAR=24.1
Subroutine diag: not called CC=1 SCAR=6.4
Subroutine diag_fail: not called CC=3 SCAR=24.1
Subroutine diag_ok: not called CC=3 SCAR=24.1
Subroutine diag_progress: not called CC=1 SCAR=6.4
Subroutine fetch_module: not called CC=12 SCAR=49.5
Subroutine format_dist: not called CC=1 SCAR=6.4
Subroutine has_shadow_install: not called CC=1 SCAR=6.4
Subroutine install: not called CC=8 SCAR=41.8
Subroutine install_module: not called CC=20 SCAR=59.4
Subroutine load_argv_from_fh: called CC=3 SCAR=24.1
Subroutine local_lib_target: not called CC=1 SCAR=6.4
Subroutine log: called CC=1 SCAR=6.4
Subroutine look: not called CC=2 SCAR=17.2
Subroutine mask_output: not called CC=1 SCAR=6.4
Subroutine maybe_abs: not called CC=4 SCAR=29.1
Subroutine numify_ver: not called CC=1 SCAR=6.4
Subroutine packlists_containing: not called CC=2 SCAR=17.2
Subroutine prompt: not called CC=13 SCAR=51.1
Subroutine prompt_bool: not called CC=1 SCAR=6.4
Subroutine resolve_name: not called CC=9 SCAR=44.1
Subroutine run: not called CC=2 SCAR=17.2
Subroutine run_exec: not called CC=4 SCAR=29.1
Subroutine run_timeout: not called CC=7 SCAR=39.3
Subroutine search_cpanmetadb: not called CC=2 SCAR=17.2
Subroutine search_cpanmetadb_history: not called CC=8 SCAR=41.8
Subroutine search_cpanmetadb_package: not called CC=3 SCAR=24.1
Subroutine search_database: not called CC=7 SCAR=39.3
Subroutine search_metacpan: not called CC=7 SCAR=39.3
Subroutine search_module: not called CC=10 SCAR=46.0
Subroutine self_upgrade: not called CC=1 SCAR=6.4
Subroutine setup_local_lib: not called CC=5 SCAR=33.1
Subroutine sha1_for: not called CC=3 SCAR=24.1
Subroutine should_unlink: not called CC=2 SCAR=17.2
Subroutine show_build_log: not called CC=5 SCAR=33.1
Subroutine show_help: not called CC=2 SCAR=17.2
Subroutine show_version: called CC=6 SCAR=36.5
Subroutine source_for: not called CC=1 SCAR=6.4
Subroutine test: not called CC=11 SCAR=47.9
Subroutine trim: not called CC=1 SCAR=6.4
Subroutine uninstall_files: not called CC=3 SCAR=24.1
Subroutine uninstall_module: not called CC=3 SCAR=24.1
Subroutine uninstall_search_path: not called CC=2 SCAR=17.2
Subroutine uninstall_target: not called CC=3 SCAR=24.1
Subroutine unpack: not called CC=5 SCAR=33.1
Subroutine unpack_packlist: not called CC=2 SCAR=17.2
Subroutine upgrade_toolchain: not called CC=4 SCAR=29.1
Subroutine uri_params: not called CC=2 SCAR=17.2
Subroutine verify_archive: not called CC=3 SCAR=24.1
Subroutine verify_checksum: not called CC=6 SCAR=36.5
Subroutine verify_signature: not called CC=2 SCAR=17.2
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Branch: 157 branches
BranchTrueFalseTotal
unless $_ eq ".packlist" and -f $_ 0 0 0
if $file eq $metadata->filename 0 0 0
if -e $name 0 0 0
if $@ and $@ ne "SIGINT\n" 0 0 0
!$self->{'exclude_vendor'} ? : 0 0 0
$error ? : 0 0 0
if $always or $self->{"verbose"} or not $self->{"quiet"} 0 0 0
unless exists $old{$n} 0 0 0
if $base =~ /\s/ 0 0 0
if (@dir) 2 0 2
if (-e $dir) 2 0 2
if (my $args = $self->{"build_args"}{$phase}) 0 0 0
if $self->{"force"} 0 0 0
if ($self->{"local_lib"}) 0 0 0
if ($ENV{"PERL_LOCAL_LIB_ROOT"} and $ENV{"PERL_MM_OPT"}) 0 0 0
if $self->{"sudo"} or _writable($App::cpanminus::script::Config{"installsitelib"}) and _writable($App::cpanminus::script::Config{"installsitebin"}) 0 0 0
if ($ENV{"PERL_MM_OPT"} and $ENV{"MODULEBUILDRC"} || $ENV{"PERL_MB_OPT"}) 0 0 0
unless exists $ENV{"PERL_USE_UNSAFE_INC"} 0 0 0
if $depth == 0 0 0 0
if $self->run_timeout($cmd, $self->{"build_timeout"}) 0 0 0
if $ans eq "s" 0 0 0
if $ans eq "r" 0 0 0
if $ans eq "e" 0 0 0
if $ans eq "l" 0 0 0
if $self->{"verbose"} 0 10 10
Cwd::chdir("File::Spec"->canonpath($_[0])) or die "$_[0]: $!" 0 0 0
unless ($self->{"pod2man"}) 0 0 0
if ($self->{"pure_perl"}) 0 0 0
unless exists $ENV{"PERL_USE_UNSAFE_INC"} 0 0 0
if $depth == 0 0 0 0
unless (@{$self->{"mirrors"};}) 0 0 0
if $version and $version ne "undef" 0 0 0
if ($self->{"in_progress"}) 0 0 0
if ($msg) 0 0 0
if ($self->{"in_progress"}) 0 0 0
if ($try++ < 3) 0 0 0
if $cancelled or $file 0 0 0
if ($cancelled) 0 0 0
unless ($file) 0 0 0
unless $dir 0 0 0
if (my $save = $self->{"save_dists"}) 0 0 0
$dist->{'pathname'} ? : 0 0 0
File::Copy::copy($file, $path) or warn $! 0 0 0
if ($depth == 0 and $self->{"test_only"}) 0 0 0
unless exists $ENV{"PERL_USE_UNSAFE_INC"} 0 0 0
if ($self->{"sudo"}) 0 0 0
if ($self->{"uninstall_shadows"} and not $ENV{"PERL_MM_OPT"}) 0 0 0
if $depth == 0 0 0 0
if ($self->{"seen"}{$module}++) 0 0 0
if ($self->{"skip_satisfied"}) 0 0 0
if ($ok) 0 0 0
unless ($dist) 0 0 0
$version ? : 0 0 0
if ($dist->{"distvname"} and $self->{"seen"}{$dist->{"distvname"}}++) 0 0 0
if ($self->{"cmd"} eq "info") 0 0 0
if ($dist->{"module"}) 0 0 0
unless ($self->satisfy_version($dist->{"module"}, $dist->{"module_version"}, $version)) 0 0 0
$version ? : 0 0 0
$dist->{'module_version'} ? : 0 0 0
if ($self->{"skip_installed"} and $ok) 0 0 0
if ($dist->{"dist"} eq "perl") 0 0 0
unless ($dist->{"dir"}) 0 0 0
if ($self->{"cmd"} eq "look") 0 0 0
if (defined(my $line = readline $fh)) 0 2 2
if $line 0 0 0
if ($shell) { } 0 0 0
if ($lib eq '_' or $lib =~ /^~/ or 'File::Spec'->file_name_is_absolute($lib)) { } 0 0 0
my $metadata = "Module::Metadata"->new_from_module($module, "inc", $inc) or return 0 0 0
defined $def ? : 0 0 0
defined $def ? : 0 0 0
if (not $self->{"prompt"} or not $isa_tty and eof STDIN) 0 0 0
if $self->{"prompt_timeout"} 0 0 0
if (defined $ans) { } 0 0 0
!defined($ans) || $ans eq '' ? : 0 0 0
if ($module =~ /(?:^git:|\.git(?:\@.+)?$)/) 0 0 0
if ($module =~ /^(ftp|https?|file):/) 0 0 0
if ($module =~ m[authors/id/(.*)]) { } 0 0 0
if ($module =~ m[^[\./]] and -d $module) 0 0 0
if (-f $module) 0 0 0
if ($module =~ s[^cpan:///distfile/][]) 0 0 0
if ($module =~ m[^(?:[A-Z]/[A-Z]{2}/)?([A-Z]{2}[\-A-Z0-9]*/.*)$]) 0 0 0
if ($pid) { } 0 0 0
if (ref $cmd eq 'ARRAY') { } 0 0 0
unless ($self->{"verbose"}) 0 0 0
unless ($self->{"verbose"}) 0 0 0
if $self->{"verbose"} or not $timeout 0 0 0
if ($pid) { } 0 0 0
elsif ($pid == 0) { } 0 0 0
if ($@ and $@ eq "alarm\n") 0 0 0
if ($self->with_version_range($version)) { } 0 0 0
my $content = $self->get($uri) or return 0 0 0
if ($line =~ /^$module\s+(\S+)\s+(\S+)$/) 0 0 0
unless @found 0 0 0
if ($self->satisfy_version($module, $try->{"version_obj"}, $version)) 0 0 0
unless $try->{"latest"} 0 0 0
if ($meta and $meta->{"distfile"}) 0 0 0
if ($self->{'dev_release'} or $self->{'metacpan'}) { } 0 0 0
$found = $self->search_metacpan($module, $version, $self->{"dev_release"}) and return $found 0 0 0
$found = $self->search_cpanmetadb($module, $version, $self->{"dev_release"}) and return $found 0 0 0
$found = $self->search_cpanmetadb($module, $version) and return $found 0 0 0
$found = $self->search_metacpan($module, $version) and return $found 0 0 0
$version ? : 0 0 0
$dev_release ? : 0 0 0
if length $query 0 0 0
if ($dist_meta and $dist_meta->{"download_url"}) 0 0 0
$version ? : 0 0 0
if ($self->{"mirror_index"}) 0 0 0
if $pkg 0 0 0
unless ($self->{"cascade_search"}) 0 0 0
unless ($self->{"mirror_only"}) 0 0 0
if $found 0 0 0
unless ($self->{"pkgs"}{$uri}) 0 0 0
$self->generate_mirror_index($mirror) or next MIRROR 0 0 0
if $pkg 0 0 0
if $base eq "_" 0 0 0
if ($self->{'self_contained'}) { } 0 0 0
unless $no_env 0 0 0
open my $fh, "<", $file or die "${file}: $!" 0 0 0
if (read $fh, $data, 4096) 0 0 0
if ($self->{'local_lib'}) { } 0 0 0
if (@pagers) 0 0 0
unless $pager 0 0 0
unless $pager 0 0 0
if ($pager) { } 0 0 0
if ($_[0]) 0 0 0
if $App::cpanminus::script::Config{$key} 14 8 22
unless ref $inc eq "CODE" 18 0 18
if $self->{"notest"} 0 0 0
if $depth == 0 0 0 0
unless exists $ENV{"PERL_USE_UNSAFE_INC"} 0 0 0
if $self->run_timeout($cmd, $self->{"test_timeout"}) 0 0 0
if ($self->{'force'}) { } 0 0 0
if $ans eq "s" 0 0 0
if $ans eq "r" 0 0 0
if $ans eq "f" 0 0 0
if $ans eq "e" 0 0 0
if $ans eq "l" 0 0 0
unlink $file or $self->diag_fail("$!: $file") 0 0 0
unless ($packlist) 0 0 0
$self->ask_permission($module, \@uninst_files) or return 0 0 0
$self->{'local_lib'} ? : 0 0 0
if ($self->has_shadow_install($metadata) or $self->{'local_lib'}) { } 0 0 0
if ($self->{"verify"}) 0 0 0
$self->verify_archive($file, $uri, $dist) or return 0 0 0
$file =~ /\.zip/i ? : 0 0 0
unless ($dir) 0 0 0
open my $fh, "<", $packlist or die "${packlist}: $!" 0 0 0
if ($deps{'ExtUtils::MakeMaker'}) { } 0 0 0
elsif ($deps{'Module::Build'}) { } 0 0 0
if (my $key = shift @params) 0 0 0
unless ($dist->{"cpanid"}) 0 0 0
unless (-e $chk_file) 0 0 0
open my $fh, "<$chk_file" or die "${chk_file}: $!" 0 0 0
if (not ref $chksum or ref $chksum ne "HASH") 0 0 0
if (my $sha = $chksum->{$file}{'sha256'}) { } 0 0 0
if ($hex eq $sha) { } 0 0 0
if ($out =~ /Signature verified OK/) { } 0 0 0
Condition0%0/114
$_ eq ".packlist" and -f $_
!ll&&!rl&&r
000
$packlist ||= $File::Find::name
l!l&&r!l&&!r
000
$@ and $@ ne "SIGINT\n"
!ll&&!rl&&r
000
$always or $self->{"verbose"} or not $self->{"quiet"}
l!l&&r!l&&!r
000
$always or $self->{"verbose"}
l!l&&r!l&&!r
000
$ENV{"PERL_LOCAL_LIB_ROOT"} and $ENV{"PERL_MM_OPT"}
!ll&&!rl&&r
000
$self->{"sudo"} or _writable($App::cpanminus::script::Config{"installsitelib"}) and _writable($App::cpanminus::script::Config{"installsitebin"})
l!l&&r!l&&!r
000
_writable($App::cpanminus::script::Config{"installsitelib"}) and _writable($App::cpanminus::script::Config{"installsitebin"})
!ll&&!rl&&r
000
$ENV{"PERL_MM_OPT"} and $ENV{"MODULEBUILDRC"} || $ENV{"PERL_MB_OPT"}
!ll&&!rl&&r
000
$ENV{"MODULEBUILDRC"} or $ENV{"PERL_MB_OPT"}
l!l&&r!l&&!r
000
$self->{'verbose'} || $self->{'interactive'}
l!l&&r!l&&!r
000
$version and $version ne "undef"
!ll&&!rl&&r
000
$msg ||= "OK"
l!l
00
$dist->{'filename'} || $uri
l!l&&r!l&&!r
000
$cancelled or $file
l!l&&r!l&&!r
000
$depth == 0 and $self->{"test_only"}
!ll&&!rl&&r
000
$self->{"uninstall_shadows"} and not $ENV{"PERL_MM_OPT"}
!ll&&!rl&&r
000
$version || 0
l!l
00
$dist->{"distvname"} and $self->{"seen"}{$dist->{"distvname"}}++
!ll&&!rl&&r
000
$self->{"skip_installed"} and $ok
!ll&&!rl&&r
000
$dist->{"dir"} ||= $self->fetch_module($dist)
l!l&&r!l&&!r
000
$lib eq "_" or $lib =~ /^~/ or "File::Spec"->file_name_is_absolute($lib)
l!l&&r!l&&!r
000
$lib eq "_" or $lib =~ /^~/
l!l&&r!l&&!r
000
-t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT))
!ll&&!rl&&r
000
-t STDOUT or not -f STDOUT || -c STDOUT
l!l&&r!l&&!r
000
-f STDOUT || -c STDOUT
l!l&&r!l&&!r
000
not $self->{"prompt"} or not $isa_tty and eof STDIN
l!l&&r!l&&!r
000
not $isa_tty and eof STDIN
!ll&&!rl&&r
000
not defined $ans or $ans eq ""
l!l&&r!l&&!r
000
$module =~ m[^[\./]] and -d $module
!ll&&!rl&&r
000
$self->{"verbose"} or not $timeout
l!l&&r!l&&!r
000
$@ and $@ eq "alarm\n"
!ll&&!rl&&r
000
$meta and $meta->{"distfile"}
!ll&&!rl&&r
000
$self->{"dev_release"} or $self->{"metacpan"}
l!l&&r!l&&!r
000
$dist_meta and $dist_meta->{"download_url"}
!ll&&!rl&&r
000
$base ||= "~/perl5"
l!l
00
$self->has_shadow_install($metadata) or $self->{"local_lib"}
l!l&&r!l&&!r
000
$deps{"ExtUtils::Install"} ||= "App::cpanminus::Dependency"->new("ExtUtils::Install", 0, "configure")
l!l&&r!l&&!r
000
not ref $chksum or ref $chksum ne "HASH"
l!l&&r!l&&!r
000
MC/DC0%0/2
$_ eq ".packlist" and -f $_
$_ eq ".packlist" -f $_
MC/DC0%0/2
$packlist ||= $File::Find::name
$packlist $File::Find::name
MC/DC0%0/2
$@ and $@ ne "SIGINT\n"
$@ $@ ne "SIGINT\n"
MC/DC0%0/3
$always or $self->{"verbose"} or not $self->{"quiet"}
$always $self->{"verbose"} not $self->{"quiet"}
MC/DC0%0/2
$ENV{"PERL_LOCAL_LIB_ROOT"} and $ENV{"PERL_MM_OPT"}
$ENV{"PERL_LOCAL_LIB_ROOT"} $ENV{"PERL_MM_OPT"}
MC/DC0%0/3
$self->{"sudo"} or _writable($App::cpanminus::script::Config{"installsitelib"}) and _writable($App::cpanminus::script::Config{"installsitebin"})
$self->{"sudo"} _writable($App::cpanminus::script::Config{"installsitelib"}) _writable($App::cpanminus::script::Config{"installsitebin"})
MC/DC0%0/3
$ENV{"PERL_MM_OPT"} and $ENV{"MODULEBUILDRC"} || $ENV{"PERL_MB_OPT"}
$ENV{"PERL_MM_OPT"} $ENV{"MODULEBUILDRC"} $ENV{"PERL_MB_OPT"}
MC/DC0%0/2
$self->{'verbose'} || $self->{'interactive'}
$self->{'verbose'} $self->{'interactive'}
MC/DC0%0/2
$version and $version ne "undef"
$version $version ne "undef"
MC/DC0%0/1
$msg ||= "OK"
$msg
MC/DC0%0/2
$dist->{'filename'} || $uri
$dist->{'filename'} $uri
MC/DC0%0/2
$cancelled or $file
$cancelled $file
MC/DC0%0/2
$depth == 0 and $self->{"test_only"}
$depth == 0 $self->{"test_only"}
MC/DC0%0/2
$self->{"uninstall_shadows"} and not $ENV{"PERL_MM_OPT"}
$self->{"uninstall_shadows"} not $ENV{"PERL_MM_OPT"}
MC/DC0%0/1
$version || 0
$version
MC/DC0%0/2
$dist->{"distvname"} and $self->{"seen"}{$dist->{"distvname"}}++
$dist->{"distvname"} $self->{"seen"}{$dist->{"distvname"}}++
MC/DC0%0/2
$self->{"skip_installed"} and $ok
$self->{"skip_installed"} $ok
MC/DC0%0/2
$dist->{"dir"} ||= $self->fetch_module($dist)
$dist->{"dir"} $self->fetch_module($dist)
MC/DC0%0/3
$lib eq "_" or $lib =~ /^~/ or "File::Spec"->file_name_is_absolute($lib)
$lib eq "_" $lib =~ /^~/ "File::Spec"->file_name_is_absolute($lib)
MC/DC0%0/4
-t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT))
-t STDIN -t STDOUT -f STDOUT -c STDOUT
MC/DC0%0/3
not $self->{"prompt"} or not $isa_tty and eof STDIN
not $self->{"prompt"} not $isa_tty eof STDIN
MC/DC0%0/2
not defined $ans or $ans eq ""
not defined $ans $ans eq ""
MC/DC0%0/2
$module =~ m[^[\./]] and -d $module
$module =~ m[^[\./]] -d $module
MC/DC0%0/2
$self->{"verbose"} or not $timeout
$self->{"verbose"} not $timeout
MC/DC0%0/2
$@ and $@ eq "alarm\n"
$@ $@ eq "alarm\n"
MC/DC0%0/2
$meta and $meta->{"distfile"}
$meta $meta->{"distfile"}
MC/DC0%0/2
$self->{"dev_release"} or $self->{"metacpan"}
$self->{"dev_release"} $self->{"metacpan"}
MC/DC0%0/2
$dist_meta and $dist_meta->{"download_url"}
$dist_meta $dist_meta->{"download_url"}
MC/DC0%0/1
$base ||= "~/perl5"
$base
MC/DC0%0/2
$self->has_shadow_install($metadata) or $self->{"local_lib"}
$self->has_shadow_install($metadata) $self->{"local_lib"}
MC/DC0%0/2
$deps{"ExtUtils::Install"} ||= "App::cpanminus::Dependency"->new("ExtUtils::Install", 0, "configure")
$deps{"ExtUtils::Install"} "App::cpanminus::Dependency"->new("ExtUtils::Install", 0, "configure")
MC/DC0%0/2
not ref $chksum or ref $chksum ne "HASH"
not ref $chksum ref $chksum ne "HASH"
Truth table0%0/3
A and B
A= $_ eq ".packlist"B= -f $_
ABresult
0X0
100
111
Truth table0%0/3
A ||= B
A= $packlistB= $File::Find::name
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= $@B= $@ ne "SIGINT\n"
ABresult
0X0
100
111
Truth table0%0/4
A or B or not(C)
A= $alwaysB= $self->{"verbose"}C= not $self->{"quiet"}
ABCresult
1XX1
01X1
0011
0000
Truth table0%0/3
A and B
A= $ENV{"PERL_LOCAL_LIB_ROOT"}B= $ENV{"PERL_MM_OPT"}
ABresult
0X0
100
111
Truth table0%0/4
A or B and C
A= $self->{"sudo"}B= _writable($App::cpanminus::script::Config{"installsitelib"})C= _writable($App::cpanminus::script::Config{"installsitebin"})
ABCresult
1XX1
0111
00X0
0100
Truth table0%0/4
A and B or C
A= $ENV{"PERL_MM_OPT"}B= $ENV{"MODULEBUILDRC"}C= $ENV{"PERL_MB_OPT"}
ABCresult
0XX0
1000
11X1
1011
Truth table0%0/3
A || B
A= $self->{'verbose'}B= $self->{'interactive'}
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= $versionB= $version ne "undef"
ABresult
0X0
100
111
Truth table0%0/2
A
A= $msg
Aresult
11
00
Truth table0%0/3
A || B
A= $dist->{'filename'}B= $uri
ABresult
1X1
011
000
Truth table0%0/3
A or B
A= $cancelledB= $file
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= $depth == 0B= $self->{"test_only"}
ABresult
0X0
100
111
Truth table0%0/3
A and not(B)
A= $self->{"uninstall_shadows"}B= not $ENV{"PERL_MM_OPT"}
ABresult
0X0
100
111
Truth table0%0/2
A
A= $version
Aresult
11
00
Truth table0%0/3
A and B
A= $dist->{"distvname"}B= $self->{"seen"}{$dist->{"distvname"}}++
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $self->{"skip_installed"}B= $ok
ABresult
0X0
100
111
Truth table0%0/3
A ||= B
A= $dist->{"dir"}B= $self->fetch_module($dist)
ABresult
1X1
011
000
Truth table0%0/4
A or B or C
A= $lib eq "_"B= $lib =~ /^~/C= "File::Spec"->file_name_is_absolute($lib)
ABCresult
1XX1
01X1
0011
0000
Truth table0%0/5
A && B or not(C || D)
A= -t STDINB= -t STDOUTC= -f STDOUTD= -c STDOUT
ABCDresult
0XXX0
101X0
10010
11XX1
10001
Truth table0%0/4
not(A) or not(B) and C
A= not $self->{"prompt"}B= not $isa_ttyC= eof STDIN
ABCresult
1XX1
0111
00X0
0100
Truth table0%0/3
not(A) or B
A= not defined $ansB= $ans eq ""
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= $module =~ m[^[\./]]B= -d $module
ABresult
0X0
100
111
Truth table0%0/3
A or not(B)
A= $self->{"verbose"}B= not $timeout
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= $@B= $@ eq "alarm\n"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $metaB= $meta->{"distfile"}
ABresult
0X0
100
111
Truth table0%0/3
A or B
A= $self->{"dev_release"}B= $self->{"metacpan"}
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= $dist_metaB= $dist_meta->{"download_url"}
ABresult
0X0
100
111
Truth table0%0/2
A
A= $base
Aresult
11
00
Truth table0%0/3
A or B
A= $self->has_shadow_install($metadata)B= $self->{"local_lib"}
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $deps{"ExtUtils::Install"}B= "App::cpanminus::Dependency"->new("ExtUtils::Install", 0, "configure")
ABresult
1X1
011
000
Truth table0%0/3
not(A) or B
A= not ref $chksumB= ref $chksum ne "HASH"
ABresult
1X1
011
000
50 Usage: cpanm [options] Module [...]
51
52 Try `cpanm --help` or `man cpanm` for more options.
53 USAGE
54 Usage: cpanm [options] Module [...]
55
56 Options:
57 -v,--verbose Turns on chatty output
58 -q,--quiet Turns off the most output
59 --interactive Turns on interactive configure (required for Task:: modules)
60 -f,--force force install
61 -n,--notest Do not run unit tests
62 --test-only Run tests only, do not install
63 -S,--sudo sudo to run install commands
64 --installdeps Only install dependencies
65 --showdeps Only display direct dependencies
66 --reinstall Reinstall the distribution even if you already have the latest version installed
67 --mirror Specify the base URL for the mirror (e.g. http://cpan.cpantesters.org/)
68 --mirror-only Use the mirror's index file instead of the CPAN Meta DB
69 -M,--from Use only this mirror base URL and its index file
70 --prompt Prompt when configure/build/test fails
71 -l,--local-lib Specify the install base to install modules
72 -L,--local-lib-contained Specify the install base to install all non-core modules
73 --self-contained Install all non-core modules, even if they're already installed.
74 --auto-cleanup Number of days that cpanm's work directories expire in. Defaults to 7
75
76 Commands:
77 --self-upgrade upgrades itself
78 --info Displays distribution info on CPAN
79 --look Opens the distribution with your SHELL
80 -U,--uninstall Uninstalls the modules (EXPERIMENTAL)
81 -V,--version Displays software version
82
83 Examples:
84
85 cpanm Test::More # install Test::More
86 cpanm MIYAGAWA/Plack-0.99_05.tar.gz # full distribution path
87 cpanm http://example.org/LDS/CGI.pm-3.20.tar.gz # install from URL
88 cpanm ~/dists/MyCompany-Enterprise-1.00.tar.gz # install from a local file
89 cpanm --interactive Task::Kensho # Configure interactively
90 cpanm . # install from local directory
91 cpanm --installdeps . # install all the deps for the current directory
92 cpanm -L extlib Plack # install Plack and all non-core deps into extlib
93 cpanm --mirror http://cpan.cpantesters.org/ DBI # use the fast-syncing mirror
94 cpanm -M https://cpan.metacpan.org App::perlbrew # use only this secure mirror and its index
95
96 You can also specify the default options in PERL_CPANM_OPT environment variable in the shell rc:
97
98 export PERL_CPANM_OPT="--prompt --reinstall -l ~/perl --mirror http://cpan.cpantesters.org"
99
100 Type `man cpanm` or `perldoc cpanm` for the more detailed explanation of the options.
101
102 HELP
103 !
104 ! Can't write to $Config{installsitelib} and $Config{installsitebin}: Installing modules to $ENV{HOME}/perl5
105 ! To turn off this warning, you have to do one of the following:
106 ! - run me as a root or with --sudo option (to install to $Config{installsitelib} and $Config{installsitebin})
107 ! - Configure local::lib in your existing shell to set PERL_MM_OPT etc.
108 ! - Install local::lib by running the following commands
109 !
110 ! cpanm --local-lib=~/perl5 local::lib && eval \$(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
111 !
112 DIAG
113 WARNING: Your lib directory name ($base) contains a space in it. It's known to cause issues with perl builder tools such as local::lib and MakeMaker. You're recommended to rename your directory.
114 WARN
115 $module is not found in the following directories and can't be uninstalled.
116
117 0 @{[ join(" \n", map " $_", @inc) ]}
118
119 0 ▶ DIAG
Subroutine DESTROY: not called CC=2 SCAR=17.1
Subroutine __ANON__: not called CC=3 SCAR=24.0
Subroutine __ANON__: not called CC=4 SCAR=29.0
Subroutine __ANON__: not called CC=1 SCAR=6.4
Subroutine __ANON__: not called CC=7 SCAR=39.2
Subroutine __ANON__: not called CC=2 SCAR=17.1
Subroutine __ANON__: not called CC=1 SCAR=6.4
Subroutine __ANON__: not called CC=3 SCAR=24.0
Subroutine __ANON__: not called CC=1 SCAR=6.4
Subroutine __ANON__: not called CC=2 SCAR=17.1
Subroutine __ANON__: not called CC=1 SCAR=6.4
Subroutine __ANON__: not called CC=1 SCAR=6.4
Subroutine __ANON__: not called CC=2 SCAR=17.1
Subroutine __ANON__: not called CC=2 SCAR=17.1
Subroutine __ANON__: not called CC=2 SCAR=17.1
Subroutine __ANON__: not called CC=2 SCAR=17.1
Subroutine __ANON__: not called CC=2 SCAR=17.1
Subroutine __ANON__: not called CC=2 SCAR=17.1
Subroutine __ANON__: not called CC=2 SCAR=17.1
Subroutine __ANON__: not called CC=1 SCAR=6.4
Subroutine __ANON__: called CC=1 SCAR=6.4
Subroutine __ANON__: not called CC=7 SCAR=39.2
Subroutine __ANON__: not called CC=7 SCAR=39.2
Subroutine __ANON__: not called CC=4 SCAR=29.0
Subroutine __ANON__: not called CC=1 SCAR=6.4
Subroutine __ANON__: not called CC=6 SCAR=36.4
Subroutine __ANON__: not called CC=8 SCAR=41.7
Subroutine _do_walk_down: not called CC=4 SCAR=29.0
Subroutine _merge_hashref: not called CC=2 SCAR=17.1
Subroutine build_stuff: not called CC=69 SCAR=83.7
Subroutine bundle_deps: not called CC=9 SCAR=43.9
Subroutine check_module: not called CC=9 SCAR=43.9
Subroutine check_perl_version: not called CC=1 SCAR=6.4
Subroutine cleanup_workdirs: not called CC=6 SCAR=36.4
Subroutine configure_features: not called CC=1 SCAR=6.4
Subroutine configure_this: not called CC=17 SCAR=56.1
Subroutine core_version_for: not called CC=3 SCAR=24.0
Subroutine dump_scandeps: not called CC=5 SCAR=33.0
Subroutine effective_feature: not called CC=10 SCAR=45.9
Subroutine extract_meta_prereqs: not called CC=10 SCAR=45.9
Subroutine extract_packages: not called CC=6 SCAR=36.4
Subroutine extract_prereqs: not called CC=1 SCAR=6.4
Subroutine file_get: not called CC=2 SCAR=17.1
Subroutine file_mirror: not called CC=3 SCAR=24.0
Subroutine find_module_name: not called CC=8 SCAR=41.7
Subroutine find_prereqs: not called CC=2 SCAR=17.1
Subroutine get: not called CC=2 SCAR=17.1
Subroutine git_uri: not called CC=4 SCAR=29.0
Subroutine has_working_lwp: called CC=2 SCAR=17.1
Subroutine init_tools: called CC=18 SCAR=57.2
Subroutine install_base: not called CC=2 SCAR=17.1
Subroutine install_deps: not called CC=12 SCAR=49.4
Subroutine install_deps_bailout: not called CC=3 SCAR=24.0
Subroutine is_deprecated: not called CC=2 SCAR=17.1
Subroutine list_files: not called CC=3 SCAR=24.0
Subroutine loaded_from_perl_lib: not called CC=6 SCAR=36.4
Subroutine mask_uri_passwords: not called CC=2 SCAR=17.1
Subroutine maybe_version: not called CC=3 SCAR=24.0
Subroutine merge_with_cpanfile: not called CC=4 SCAR=29.0
Subroutine mirror: not called CC=2 SCAR=17.1
Subroutine perl_requirements: not called CC=3 SCAR=24.0
Subroutine safe_eval: not called CC=1 SCAR=6.4
Subroutine safeexec: not called CC=4 SCAR=29.0
Subroutine satisfy_version: not called CC=3 SCAR=24.0
Subroutine save_meta: not called CC=10 SCAR=45.9
Subroutine scandeps_append_child: not called CC=2 SCAR=17.1
Subroutine search_inc: not called CC=3 SCAR=24.0
Subroutine setup_module_build_patch: not called CC=2 SCAR=17.1
Subroutine shell_quote: not called CC=1 SCAR=6.4
Subroutine should_install: not called CC=4 SCAR=29.0
Subroutine should_use_mm: not called CC=1 SCAR=6.4
Subroutine soften_makemaker_prereqs: not called CC=4 SCAR=29.0
Subroutine unsatisfied_deps: not called CC=3 SCAR=24.0
Subroutine unsatisfy_how: not called CC=2 SCAR=17.1
Subroutine untar: not called CC=1 SCAR=6.4
Subroutine unzip: not called CC=1 SCAR=6.4
Subroutine uri_to_file: not called CC=3 SCAR=24.0
Subroutine walk_down: not called CC=1 SCAR=6.4
Subroutine which: called CC=9 SCAR=43.9
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Branch: 202 branches
BranchTrueFalseTotal
if ($url) { } 0 0 0
unless ref $url eq "ARRAY" 0 0 0
if $self->{"at_exit"} 0 0 0
if (-e "Makefile.PL") 0 0 0
if ($self->configure([$self->{"perl"}, "Makefile.PL"], $depth)) 0 0 0
if (-e "Build.PL") 0 0 0
if ($self->configure([$self->{"perl"}, "Build.PL"], $depth)) 0 0 0
if $file =~ m[^(?:x?t|inc|local|perl5|fatlib|_build)/] 0 0 0
unless $meta->{"no_index"} 0 0 0
if grep {$file =~ m[^$_/];} @{$meta->{"no_index"}{"directory"} or [];} 0 0 0
if grep {$file eq $_;} @{$meta->{"no_index"}{"file"} or [];} 0 0 0
$meta and $meta->name eq $dist->{"module"} 0 0 0
if /\.pm$/i and &$match($_) 0 0 0
if ($depth == 0) { } 0 0 0
unless $res->is_success 0 0 0
if $res->code == 501 0 0 0
$self->safeexec(my $fh, $wget, $uri, @common, "-O", "-") or die "wget ${uri}: $!" 0 0 0
$self->safeexec(my $fh, $wget, $uri, @common, "-O", $path) or die "wget ${uri}: $!" 0 0 0
$self->safeexec(my $fh, $curl, @common, $uri) or die "curl ${uri}: $!" 0 0 0
$self->safeexec(my $fh, $curl, @common, $uri, "-#", "-o", $path) or die "curl ${uri}: $!" 0 0 0
unless $res->{"success"} 0 0 0
$self->{'verbose'} ? : 0 0 0
$tarfile =~ /bz2$/ ? : 0 0 0
() = `$tar ${ar}tf $tarfile` or return undef 0 0 0
unless (length $root) 0 0 0
if $root 0 0 0
if -d $root 0 0 0
$self->{'verbose'} ? : 0 0 0
$tarfile =~ /bz2$/ ? : 0 0 0
() = `$ar -dc $tarfile | $tar tf -` or return undef 0 0 0
unless (length $root) 0 0 0
if $root 0 0 0
if -d $root 0 0 0
unless (length $root) 0 0 0
if $root 0 0 0
-d $root ? : 0 0 0
$self->{'verbose'} ? : 0 0 0
my(undef, $root, @others) = `$unzip -t $zipfile` or return undef 0 0 0
unless ($root =~ s[^\s+testing:\s+([^/]+)/.*?\s+OK$][$1]) 0 0 0
if $root 0 0 0
if -d $root 0 0 0
eval { do { require Archive::Zip } } or die "Failed to extract $_[1] - You need to have unzip or Archive::Zip installed.\n" 0 0 0
if $status != Archive::Zip::AZ_OK() 0 0 0
if $af =~ m[^(/|\.\./)] 0 0 0
if $status != Archive::Zip::AZ_OK() 0 0 0
-d $root ? : 0 0 0
if $pre 0 0 0
unless $pre 0 0 0
if ($self->{"verify"} and -e "SIGNATURE") 0 0 0
$self->verify_signature($dist) or return 0 0 0
if ($meta_file) { } 0 0 0
elsif ($dist->{'dist'} and $dist->{'version'}) { } 0 0 0
$dist->{'cpanmeta'} ? : 0 0 0
if ($dist->{"cpanmeta"}) 0 0 0
if (-e "Build.PL" and not $self->should_use_mm($dist->{"dist"}) and not @config_deps) 0 0 0
$dist->{'meta'}{'name'} ? : 0 0 0
$self->install_deps_bailout($target, $dist->{"dir"}, $depth, @config_deps) or return 0 0 0
$configure_state->{'configured_ok'} ? : 0 0 0
if ($dist->{"cpanmeta"} and $dist->{"source"} eq "cpan") 0 0 0
$self->{'notest'} && !$root_target ? : 0 0 0
if $self->{"with_develop"} and $depth == 0 0 0 0
if $self->{"with_configure"} and $depth == 0 0 0 0
if ($self->{"showdeps"}) 0 0 0
$dep->version ? : 0 0 0
$dist->{'meta'}{'name'} ? : 0 0 0
if ($self->{"scandeps"}) 0 0 0
$self->install_deps_bailout($distname, $dist->{"dir"}, $depth, @deps) or return 0 0 0
if ($self->{"scandeps"}) 0 0 0
unless ($configure_state->{"configured_ok"}) 0 0 0
if (@config_deps) 0 0 0
if @tree 0 0 0
if ($self->{"installdeps"} and $depth == 0) 0 0 0
if ($configure_state->{'configured_ok'}) { } 0 0 0
if ($configure_state->{'use_module_build'} and -e 'Build' and -f _) { } 0 0 0
elsif ($self->{'make'} and -e 'Makefile') { } 0 0 0
$self->{'notest'} ? : 0 0 0
$self->build([$self->{"perl"}, "./Build"], $distname, $depth) and $self->test([$self->{"perl"}, "./Build", "test"], $distname, $depth) and $self->install([$self->{"perl"}, "./Build", "install"], ["--uninst", 1], $depth) and ++$installed 0 0 0
$self->{'notest'} ? : 0 0 0
$self->build([$self->{"make"}], $distname, $depth) and $self->test([$self->{"make"}, "test"], $distname, $depth) and $self->install([$self->{"make"}, "install"], ["UNINST=1"], $depth) and ++$installed 0 0 0
if ($configure_failed) { } 0 0 0
elsif ($self->{'make'}) { } 0 0 0
if ($installed and $self->{'test_only'}) { } 0 0 0
elsif ($installed) { } 0 0 0
$local && !$reinstall ? : 0 0 0
$self->numify_ver($version) < $self->numify_ver($local) ? : 0 0 0
$reinstall ? : 0 0 0
$local ? : 0 0 0
$self->{'test_only'} ? : 0 0 0
if ($dist->{'module'}) { } 0 0 0
open my $pod, "<", $file or next 0 0 0
if (defined($_ = readline $pod)) 0 0 0
if (/^=head\d\s+CONTENTS/) { } 0 0 0
elsif (/^=/) { } 0 0 0
elsif ($in_contents) { } 0 0 0
/^(\S+)\s*(\S+)?/ and push @deps, "App::cpanminus::Dependency"->new($1, $self->maybe_version($2)) 0 0 0
my $meta = "Module::Metadata"->new_from_module($mod, "inc", $self->search_inc) or return 0, undef 0 0 0
if ($self->{"self_contained"} and $self->loaded_from_perl_lib($meta)) 0 0 0
if $version and $version == -1 0 0 0
if ($self->is_deprecated($meta)) { } 0 0 0
elsif ($self->satisfy_version($mod, $version, $want_ver)) { } 0 0 0
if (defined(my $e = readdir $dh)) 0 0 0
unless $e =~ /^(\d+)\.\d+$/ 0 0 0
if ($time < $expire) 0 0 0
if (@targets) 0 0 0
if (@targets >= 64) { } 0 0 0
if (-e $self->{"cpanfile_path"} and $self->{"installdeps"} and $depth == 0) 0 0 0
if $@ 0 0 0
if ($self->{"skip_configure"}) 0 0 0
if ($dist->{'dist'} and $self->should_use_mm($dist->{'dist'})) { } 0 0 0
if $state->{"configured_ok"} 0 0 0
unless ($state->{"configured_ok"}) 0 0 0
if $ans eq "s" 0 0 0
if $ans eq "r" 0 0 0
if $ans eq "e" 0 0 0
if $ans eq "l" 0 0 0
unless (exists $Module::CoreList::version{$] + 0}) 0 0 0
unless (exists $Module::CoreList::version{$] + 0}{$module}) 0 0 0
if ($self->{'format'} eq 'tree') { } 0 0 0
elsif ($self->{'format'} =~ /^dists?$/) { } 0 0 0
elsif ($self->{'format'} eq 'json') { } 0 0 0
elsif ($self->{'format'} eq 'yaml') { } 0 0 0
if ($dist->{"depth"} == 0) 0 0 0
if defined $value 0 0 0
if $self->{"features"}{"__all"} 0 0 0
if ($self->{"interactive"}) 0 0 0
if ($self->should_install($module, $req->{$module})) 0 0 0
if (@missing) 0 0 0
if ($dist->{"cpanfile"}) 0 0 0
if ($meta_file) 0 0 0
if ($mymeta) 0 0 0
if (-e '_build/prereqs') { } 0 0 0
elsif (-e 'Makefile') { } 0 0 0
if (defined($_ = readline $mf)) 0 0 0
if (/^\#\s+PREREQ_PM => \{\s*(.*?)\s*\}/) 0 0 0
if $prereq 0 0 0
if (() = each %$packages) 0 0 0
$meta->{'version'} eq 'undef' ? : 0 0 0
open my $fh, "<$file" or return 0 0 0
if -e $path and (stat $path)[9] >= $source_mtime 0 0 0
unless $state->{"configured_ok"} 0 0 0
if ($state->{'use_module_build'} and -e '_build/build_params') { } 0 0 0
elsif (-e 'Makefile') { } 0 0 0
if (defined($_ = readline $mf)) 0 0 0
if (/^\#\s+NAME\s+=>\s+(.*)/) 0 0 0
if ($dist->{"module"} =~ /^Bundle::/i) 0 0 0
if ($uri =~ /^file:/) { } 0 0 0
unless (-e "$dir/.git") 0 0 0
if ($commitish) 0 0 0
unless ($self->run(["git", "checkout", $commitish])) 0 0 0
if $https 0 2 2
if $self->{"initialized"}++ 0 2 2
if ($self->{"make"} = $self->which($App::cpanminus::script::Config{"make"})) 2 0 2
if ($self->{'try_lwp'} and $self->has_working_lwp($self->{'mirrors'})) { } 2 0 2
elsif ($self->{'try_wget'} and my $wget = $self->which('wget')) { } 0 0 0
elsif ($self->{'try_curl'} and my $curl = $self->which('curl')) { } 0 0 0
$self->{'verbose'} ? : 0 0 0
$self->{'verbose'} ? : 0 0 0
if ($tar and not &$maybe_bad_tar()) { } 2 0 2
elsif ($tar and my $gzip = $self->which('gzip') and my $bzip2 = $self->which('bzip2')) { } 0 0 0
elsif (eval { do { require Archive::Tar } }) { } 0 0 0
if (my $unzip = $self->which('unzip')) { } 2 0 2
$mm_opt =~ /INSTALL_BASE=(\S+)/ and return $1 0 0 0
if $seen{$dep->module} 0 0 0
if ($dep->module eq 'perl') { } 0 0 0
elsif ($self->should_install($dep->module, $dep->version)) { } 0 0 0
if ($dep->is_requirement and not $self->check_perl_version($dep->version)) 0 0 0
if (@install) 0 0 0
if $dir 0 0 0
if ($self->{"scandeps"}) 0 0 0
if (@not_ok) { } 0 0 0
unless ($ok) 0 0 0
unless ($self->prompt_bool("Do you want to continue building $target anyway?", "n")) 0 0 0
if (-e 'MANIFEST') { } 0 0 0
if ($self->{"self_contained"} and not $self->{"exclude_vendor"} and $App::cpanminus::script::Config{"vendorarch"}) 0 0 0
if ($confdir eq substr($meta->filename, 0, length $confdir)) 0 0 0
$string && $string =~ /^\.?\d/ ? : 0 0 0
if ($self->{"cpanfile_requirements"} and not $dist->{"cpanfile"}) 0 0 0
if ($uri =~ /^file:/) { } 0 0 0
if (exists $requires->{"perl"}) 0 0 0
if (my $pid = open($rdr, '-|')) { } 0 0 0
elsif (defined $pid) { } 0 0 0
unless defined $want_ver and length $want_ver 0 0 0
unless $dist->{"distvname"} and $dist->{"source"} eq "cpan" 0 0 0
($ENV{'PERL_MM_OPT'} || '') =~ /INSTALL_BASE=/ ? : 0 0 0
exists $provides->{$module_name} ? : 0 0 0
open my $fh, ">", "blib/meta/install.json" or die $! 0 0 0
if (-e "MYMETA.json") 0 0 0
$self->{'sudo'} ? : 0 0 0
if (defined $main::Bin) { } 0 0 0
open my $out, qq[>$self->{"base"}/ModuleBuildSkipMan.pm] or die $! 0 0 0
if ($ok) { } 0 0 0
elsif ($local) { } 0 0 0
unless $ok 0 0 0
unless -e "inc/Module/Install.pm" 0 0 0
if ($reqs->requirements_for_module("ExtUtils::MakeMaker")) 0 0 0
if ($want_ver =~ /^[v0-9\.\_]+$/) { } 0 0 0
if ($uri =~ s[file:/+][]) 0 0 0
unless $uri =~ /[a-zA-Z]:/ 0 0 0
if ("File::Spec"->file_name_is_absolute($name)) 0 6 6
if (-x $name and not -d _) 0 0 0
if (-x $fullpath || -x ($fullpath .= $exe_ext) and not -d _) 6 42 48
if ($fullpath =~ /\s/) 0 6 6
Condition3%6/197
-e 'Build' && -f _
!ll&&!rl&&r
000
$meta->{'no_index'}{'directory'} || []
l!l
00
$meta->{'no_index'}{'file'} || []
l!l
00
/\.pm$/i and &$match($_)
!ll&&!rl&&r
000
$root &&= $root->fileName
!ll&&!rl&&r
000
$self->{"verify"} and -e "SIGNATURE"
!ll&&!rl&&r
000
$dist->{"dist"} and $dist->{"version"}
!ll&&!rl&&r
000
-e "Build.PL" and not $self->should_use_mm($dist->{"dist"}) and not @config_deps
!ll&&!rl&&r
000
-e "Build.PL" and not $self->should_use_mm($dist->{"dist"})
!ll&&!rl&&r
000
$dist->{"cpanmeta"} and $dist->{"source"} eq "cpan"
!ll&&!rl&&r
000
$dist->{'cpanmeta'}{'provides'} || $self->extract_packages($dist->{'cpanmeta'}, '.')
l!l&&r!l&&!r
000
($self->{'installdeps'} || $self->{'showdeps'}) && $depth == 0
!ll&&!rl&&r
000
$self->{"installdeps"} or $self->{"showdeps"}
l!l&&r!l&&!r
000
$self->{"notest"} and not $root_target
!ll&&!rl&&r
000
$self->{"with_develop"} and $depth == 0
!ll&&!rl&&r
000
$self->{"with_configure"} and $depth == 0
!ll&&!rl&&r
000
$self->find_module_name($configure_state) || $dist->{'meta'}{'name'}
l!l&&r!l&&!r
000
$self->{"installdeps"} and $depth == 0
!ll&&!rl&&r
000
$configure_state->{"use_module_build"} and -e "Build" and -f _
!ll&&!rl&&r
000
$configure_state->{"use_module_build"} and -e "Build"
!ll&&!rl&&r
000
$self->build([$self->{"perl"}, "./Build"], $distname, $depth) and $self->test([$self->{"perl"}, "./Build", "test"], $distname, $depth) and $self->install([$self->{"perl"}, "./Build", "install"], ["--uninst", 1], $depth)
!ll&&!rl&&r
000
$self->build([$self->{"perl"}, "./Build"], $distname, $depth) and $self->test([$self->{"perl"}, "./Build", "test"], $distname, $depth)
!ll&&!rl&&r
000
$self->{"make"} and -e "Makefile"
!ll&&!rl&&r
000
$self->build([$self->{"make"}], $distname, $depth) and $self->test([$self->{"make"}, "test"], $distname, $depth) and $self->install([$self->{"make"}, "install"], ["UNINST=1"], $depth)
!ll&&!rl&&r
000
$self->build([$self->{"make"}], $distname, $depth) and $self->test([$self->{"make"}, "test"], $distname, $depth)
!ll&&!rl&&r
000
$configure_state->{'configured'} && !$configure_state->{'configured_ok'}
!ll&&!rl&&r
000
$installed and $self->{"test_only"}
!ll&&!rl&&r
000
$dist->{'module'} || ''
l!l
00
$dist->{'module_version'} || $dist->{'meta'}{'version'} || $dist->{'version'}
l!l&&r!l&&!r
000
$dist->{"module_version"} or $dist->{"meta"}{"version"}
l!l&&r!l&&!r
000
$local && $local eq $version
!ll&&!rl&&r
000
$local and not $reinstall
!ll&&!rl&&r
000
$self->{"self_contained"} and $self->loaded_from_perl_lib($meta)
!ll&&!rl&&r
000
$version and $version == -1
!ll&&!rl&&r
000
$version || 'undef'
l!l
00
-e $self->{"cpanfile_path"} and $self->{"installdeps"} and $depth == 0
!ll&&!rl&&r
000
-e $self->{"cpanfile_path"} and $self->{"installdeps"}
!ll&&!rl&&r
000
-e 'Build' && -f _
!ll&&!rl&&r
000
$eumm || $mb
l!l&&r!l&&!r
000
$dist->{"dist"} and $self->should_use_mm($dist->{"dist"})
!ll&&!rl&&r
000
/\.pm(?:\.PL)?$/ && &$try($_)
!ll&&!rl&&r
000
$provides->{$package} ||= {"file", $meta->{"infile"}, $meta->{"version"} eq "undef" ? () : ("version", $meta->{"version"})}
l!l
00
-e $path and (stat $path)[9] >= $source_mtime
!ll&&!rl&&r
000
$state->{"use_module_build"} and -e "_build/build_params"
!ll&&!rl&&r
000
eval { do { $params->[2]{'module_name'} } } || undef
l!l
00
$self->{"try_lwp"} and $self->has_working_lwp($self->{"mirrors"})
!ll&&!rl&&r
002
$self->{"try_wget"} and my $wget = $self->which("wget")
!ll&&!rl&&r
000
$self->{"try_curl"} and my $curl = $self->which("curl")
!ll&&!rl&&r
000
$tar and not &$maybe_bad_tar()
!ll&&!rl&&r
002
$tar and my $gzip = $self->which("gzip") and my $bzip2 = $self->which("bzip2")
!ll&&!rl&&r
000
$tar and my $gzip = $self->which("gzip")
!ll&&!rl&&r
000
$dep->is_requirement and not $self->check_perl_version($dep->version)
!ll&&!rl&&r
000
$deprecated && $self->loaded_from_perl_lib($meta)
!ll&&!rl&&r
000
eval { do { ExtUtils::Manifest::manifind() } } || {}
l!l
00
$self->{"self_contained"} and not $self->{"exclude_vendor"} and $App::cpanminus::script::Config{"vendorarch"}
!ll&&!rl&&r
000
$self->{"self_contained"} and not $self->{"exclude_vendor"}
!ll&&!rl&&r
000
$string and $string =~ /^\.?\d/
!ll&&!rl&&r
000
$self->{"cpanfile_requirements"} and not $dist->{"cpanfile"}
!ll&&!rl&&r
000
$_[0] ||= &Symbol::gensym()
l!l&&r!l&&!r
000
defined $want_ver and length $want_ver
!ll&&!rl&&r
000
$dist->{"distvname"} and $dist->{"source"} eq "cpan"
!ll&&!rl&&r
000
$ENV{'PERL_MM_OPT'} || ''
l!l
00
$provides->{$module_name}{"version"} or $dist->{"version"}
l!l&&r!l&&!r
000
$self->{'scandeps_current'} || [undef, $self->{'scandeps_tree'}]
l!l
00
$self->{"search_inc"} ||= do { if (defined $main::Bin) { [grep((!m[^\Q$main::Bin\E/../(?:fat)?lib$]), @INC)]; } else { [@INC]; } }
l!l&&r!l&&!r
000
$dep->requires_version || '0'
l!l
00
-x $name and not -d _
!ll&&!rl&&r
000
-x $fullpath || -x ($fullpath .= $exe_ext) and not -d _
!ll&&!rl&&r
4206
-x $fullpath or -x ($fullpath .= $exe_ext)
l!l&&r!l&&!r
6042
MC/DC0%0/2
-e 'Build' && -f _
-e 'Build' -f _
MC/DC0%0/1
$meta->{'no_index'}{'directory'} || []
$meta->{'no_index'}{'directory'}
MC/DC0%0/1
$meta->{'no_index'}{'file'} || []
$meta->{'no_index'}{'file'}
MC/DC0%0/2
/\.pm$/i and &$match($_)
/\.pm$/i &$match($_)
MC/DC0%0/2
$root &&= $root->fileName
$root $root->fileName
MC/DC0%0/2
$self->{"verify"} and -e "SIGNATURE"
$self->{"verify"} -e "SIGNATURE"
MC/DC0%0/2
$dist->{"dist"} and $dist->{"version"}
$dist->{"dist"} $dist->{"version"}
MC/DC0%0/3
-e "Build.PL" and not $self->should_use_mm($dist->{"dist"}) and not @config_deps
-e "Build.PL" not $self->should_use_mm($dist->{"dist"}) not @config_deps
MC/DC0%0/2
$dist->{"cpanmeta"} and $dist->{"source"} eq "cpan"
$dist->{"cpanmeta"} $dist->{"source"} eq "cpan"
MC/DC0%0/2
$dist->{'cpanmeta'}{'provides'} || $self->extract_packages($dist->{'cpanmeta'}, '.')
$dist->{'cpanmeta'}{'provides'} $self->extract_packages($dist->{'cpanmeta'}, '.')
MC/DC0%0/3
($self->{'installdeps'} || $self->{'showdeps'}) && $depth == 0
$self->{"installdeps"} $self->{"showdeps"} $depth == 0
MC/DC0%0/2
$self->{"notest"} and not $root_target
$self->{"notest"} not $root_target
MC/DC0%0/2
$self->{"with_develop"} and $depth == 0
$self->{"with_develop"} $depth == 0
MC/DC0%0/2
$self->{"with_configure"} and $depth == 0
$self->{"with_configure"} $depth == 0
MC/DC0%0/2
$self->find_module_name($configure_state) || $dist->{'meta'}{'name'}
$self->find_module_name($configure_state) $dist->{'meta'}{'name'}
MC/DC0%0/2
$self->{"installdeps"} and $depth == 0
$self->{"installdeps"} $depth == 0
MC/DC0%0/3
$configure_state->{"use_module_build"} and -e "Build" and -f _
$configure_state->{"use_module_build"} -e "Build" -f _
MC/DC0%0/3
$self->build([$self->{"perl"}, "./Build"], $distname, $depth) and $self->test([$self->{"perl"}, "./Build", "test"], $distname, $depth) and $self->install([$self->{"perl"}, "./Build", "install"], ["--uninst", 1], $depth)
$self->build([$self->{"perl"}, "./Build"], $distname, $depth) $self->test([$self->{"perl"}, "./Build", "test"], $distname, $depth) $self->install([$self->{"perl"}, "./Build", "install"], ["--uninst", 1], $depth)
MC/DC0%0/2
$self->{"make"} and -e "Makefile"
$self->{"make"} -e "Makefile"
MC/DC0%0/3
$self->build([$self->{"make"}], $distname, $depth) and $self->test([$self->{"make"}, "test"], $distname, $depth) and $self->install([$self->{"make"}, "install"], ["UNINST=1"], $depth)
$self->build([$self->{"make"}], $distname, $depth) $self->test([$self->{"make"}, "test"], $distname, $depth) $self->install([$self->{"make"}, "install"], ["UNINST=1"], $depth)
MC/DC0%0/2
$configure_state->{'configured'} && !$configure_state->{'configured_ok'}
$configure_state->{'configured'} !$configure_state->{'configured_ok'}
MC/DC0%0/2
$installed and $self->{"test_only"}
$installed $self->{"test_only"}
MC/DC0%0/1
$dist->{'module'} || ''
$dist->{'module'}
MC/DC0%0/3
$dist->{'module_version'} || $dist->{'meta'}{'version'} || $dist->{'version'}
$dist->{"module_version"} $dist->{"meta"}{"version"} $dist->{'version'}
MC/DC0%0/2
$local && $local eq $version
$local $local eq $version
MC/DC0%0/2
$local and not $reinstall
$local not $reinstall
MC/DC0%0/2
$self->{"self_contained"} and $self->loaded_from_perl_lib($meta)
$self->{"self_contained"} $self->loaded_from_perl_lib($meta)
MC/DC0%0/2
$version and $version == -1
$version $version == -1
MC/DC0%0/1
$version || 'undef'
$version
MC/DC0%0/3
-e $self->{"cpanfile_path"} and $self->{"installdeps"} and $depth == 0
-e $self->{"cpanfile_path"} $self->{"installdeps"} $depth == 0
MC/DC0%0/2
-e 'Build' && -f _
-e 'Build' -f _
MC/DC0%0/2
$eumm || $mb
$eumm $mb
MC/DC0%0/2
$dist->{"dist"} and $self->should_use_mm($dist->{"dist"})
$dist->{"dist"} $self->should_use_mm($dist->{"dist"})
MC/DC0%0/2
/\.pm(?:\.PL)?$/ && &$try($_)
/\.pm(?:\.PL)?$/ &$try($_)
MC/DC0%0/1
$provides->{$package} ||= {"file", $meta->{"infile"}, $meta->{"version"} eq "undef" ? () : ("version", $meta->{"version"})}
$provides->{$package}
MC/DC0%0/2
-e $path and (stat $path)[9] >= $source_mtime
-e $path (stat $path)[9] >= $source_mtime
MC/DC0%0/2
$state->{"use_module_build"} and -e "_build/build_params"
$state->{"use_module_build"} -e "_build/build_params"
MC/DC0%0/1
eval { do { $params->[2]{'module_name'} } } || undef
eval { do { $params->[2]{'module_name'} } }
MC/DC0%0/2
$self->{"try_lwp"} and $self->has_working_lwp($self->{"mirrors"})
$self->{"try_lwp"} $self->has_working_lwp($self->{"mirrors"})
MC/DC0%0/2
$self->{"try_wget"} and my $wget = $self->which("wget")
$self->{"try_wget"} my $wget = $self->which("wget")
MC/DC0%0/2
$self->{"try_curl"} and my $curl = $self->which("curl")
$self->{"try_curl"} my $curl = $self->which("curl")
MC/DC0%0/2
$tar and not &$maybe_bad_tar()
$tar not &$maybe_bad_tar()
MC/DC0%0/3
$tar and my $gzip = $self->which("gzip") and my $bzip2 = $self->which("bzip2")
$tar my $gzip = $self->which("gzip") my $bzip2 = $self->which("bzip2")
MC/DC0%0/2
$dep->is_requirement and not $self->check_perl_version($dep->version)
$dep->is_requirement not $self->check_perl_version($dep->version)
MC/DC0%0/2
$deprecated && $self->loaded_from_perl_lib($meta)
$deprecated $self->loaded_from_perl_lib($meta)
MC/DC0%0/1
eval { do { ExtUtils::Manifest::manifind() } } || {}
eval { do { ExtUtils::Manifest::manifind() } }
MC/DC0%0/3
$self->{"self_contained"} and not $self->{"exclude_vendor"} and $App::cpanminus::script::Config{"vendorarch"}
$self->{"self_contained"} not $self->{"exclude_vendor"} $App::cpanminus::script::Config{"vendorarch"}
MC/DC0%0/2
$string and $string =~ /^\.?\d/
$string $string =~ /^\.?\d/
MC/DC0%0/2
$self->{"cpanfile_requirements"} and not $dist->{"cpanfile"}
$self->{"cpanfile_requirements"} not $dist->{"cpanfile"}
MC/DC0%0/2
$_[0] ||= &Symbol::gensym()
$_[0] &Symbol::gensym()
MC/DC0%0/2
defined $want_ver and length $want_ver
defined $want_ver length $want_ver
MC/DC0%0/2
$dist->{"distvname"} and $dist->{"source"} eq "cpan"
$dist->{"distvname"} $dist->{"source"} eq "cpan"
MC/DC0%0/1
$ENV{'PERL_MM_OPT'} || ''
$ENV{'PERL_MM_OPT'}
MC/DC0%0/2
$provides->{$module_name}{"version"} or $dist->{"version"}
$provides->{$module_name}{"version"} $dist->{"version"}
MC/DC0%0/1
$self->{'scandeps_current'} || [undef, $self->{'scandeps_tree'}]
$self->{'scandeps_current'}
MC/DC0%0/2
$self->{"search_inc"} ||= do { if (defined $main::Bin) { [grep((!m[^\Q$main::Bin\E/../(?:fat)?lib$]), @INC)]; } else { [@INC]; } }
$self->{"search_inc"} do { if (defined $main::Bin) { [grep((!m[^\Q$main::Bin\E/../(?:fat)?lib$]), @INC)]; } else { [@INC]; } }
MC/DC0%0/1
$dep->requires_version || '0'
$dep->requires_version
MC/DC0%0/2
-x $name and not -d _
-x $name not -d _
MC/DC33%1/3
-x $fullpath || -x ($fullpath .= $exe_ext) and not -d _
-x $fullpath -x ($fullpath .= $exe_ext) not -d _
Truth table0%0/3
A && B
A= -e 'Build'B= -f _
ABresult
0X0
100
111
Truth table0%0/2
A
A= $meta->{'no_index'}{'directory'}
Aresult
11
00
Truth table0%0/2
A
A= $meta->{'no_index'}{'file'}
Aresult
11
00
Truth table0%0/3
A and B
A= /\.pm$/iB= &$match($_)
ABresult
0X0
100
111
Truth table0%0/3
A &&= B
A= $rootB= $root->fileName
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $self->{"verify"}B= -e "SIGNATURE"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $dist->{"dist"}B= $dist->{"version"}
ABresult
0X0
100
111
Truth table0%0/4
A and not(B) and not(C)
A= -e "Build.PL"B= not $self->should_use_mm($dist->{"dist"})C= not @config_deps
ABCresult
0XX0
10X0
1100
1111
Truth table0%0/3
A and B
A= $dist->{"cpanmeta"}B= $dist->{"source"} eq "cpan"
ABresult
0X0
100
111
Truth table0%0/3
A || B
A= $dist->{'cpanmeta'}{'provides'}B= $self->extract_packages($dist->{'cpanmeta'}, '.')
ABresult
1X1
011
000
Truth table0%0/5
A or B && C
A= $self->{"installdeps"}B= $self->{"showdeps"}C= $depth == 0
ABCresult
00X0
1X00
0100
1X11
0111
Truth table0%0/3
A and not(B)
A= $self->{"notest"}B= not $root_target
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $self->{"with_develop"}B= $depth == 0
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $self->{"with_configure"}B= $depth == 0
ABresult
0X0
100
111
Truth table0%0/3
A || B
A= $self->find_module_name($configure_state)B= $dist->{'meta'}{'name'}
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= $self->{"installdeps"}B= $depth == 0
ABresult
0X0
100
111
Truth table0%0/4
A and B and C
A= $configure_state->{"use_module_build"}B= -e "Build"C= -f _
ABCresult
0XX0
10X0
1100
1111
Truth table0%0/4
A and B and C
A= $self->build([$self->{"perl"}, "./Build"], $distname, $depth)B= $self->test([$self->{"perl"}, "./Build", "test"], $distname, $depth)C= $self->install([$self->{"perl"}, "./Build", "install"], ["--uninst", 1], $depth)
ABCresult
0XX0
10X0
1100
1111
Truth table0%0/3
A and B
A= $self->{"make"}B= -e "Makefile"
ABresult
0X0
100
111
Truth table0%0/4
A and B and C
A= $self->build([$self->{"make"}], $distname, $depth)B= $self->test([$self->{"make"}, "test"], $distname, $depth)C= $self->install([$self->{"make"}, "install"], ["UNINST=1"], $depth)
ABCresult
0XX0
10X0
1100
1111
Truth table0%0/3
A && not(B)
A= $configure_state->{'configured'}B= !$configure_state->{'configured_ok'}
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $installedB= $self->{"test_only"}
ABresult
0X0
100
111
Truth table0%0/2
A
A= $dist->{'module'}
Aresult
11
00
Truth table0%0/4
A or B || C
A= $dist->{"module_version"}B= $dist->{"meta"}{"version"}C= $dist->{'version'}
ABCresult
1XX1
01X1
0011
0000
Truth table0%0/3
A && B
A= $localB= $local eq $version
ABresult
0X0
100
111
Truth table0%0/3
A and not(B)
A= $localB= not $reinstall
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $self->{"self_contained"}B= $self->loaded_from_perl_lib($meta)
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $versionB= $version == -1
ABresult
0X0
100
111
Truth table0%0/2
A
A= $version
Aresult
11
00
Truth table0%0/4
A and B and C
A= -e $self->{"cpanfile_path"}B= $self->{"installdeps"}C= $depth == 0
ABCresult
0XX0
10X0
1100
1111
Truth table0%0/3
A && B
A= -e 'Build'B= -f _
ABresult
0X0
100
111
Truth table0%0/3
A || B
A= $eummB= $mb
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= $dist->{"dist"}B= $self->should_use_mm($dist->{"dist"})
ABresult
0X0
100
111
Truth table0%0/3
A && B
A= /\.pm(?:\.PL)?$/B= &$try($_)
ABresult
0X0
100
111
Truth table0%0/2
A
A= $provides->{$package}
Aresult
11
00
Truth table0%0/3
A and B
A= -e $pathB= (stat $path)[9] >= $source_mtime
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $state->{"use_module_build"}B= -e "_build/build_params"
ABresult
0X0
100
111
Truth table0%0/2
A
A= eval { do { $params->[2]{'module_name'} } }
Aresult
11
00
Truth table33%1/3
A and B
A= $self->{"try_lwp"}B= $self->has_working_lwp($self->{"mirrors"})
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $self->{"try_wget"}B= my $wget = $self->which("wget")
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $self->{"try_curl"}B= my $curl = $self->which("curl")
ABresult
0X0
100
111
Truth table33%1/3
A and not(B)
A= $tarB= not &$maybe_bad_tar()
ABresult
0X0
100
111
Truth table0%0/4
A and B and C
A= $tarB= my $gzip = $self->which("gzip")C= my $bzip2 = $self->which("bzip2")
ABCresult
0XX0
10X0
1100
1111
Truth table0%0/3
A and not(B)
A= $dep->is_requirementB= not $self->check_perl_version($dep->version)
ABresult
0X0
100
111
Truth table0%0/3
A && B
A= $deprecatedB= $self->loaded_from_perl_lib($meta)
ABresult
0X0
100
111
Truth table0%0/2
A
A= eval { do { ExtUtils::Manifest::manifind() } }
Aresult
11
00
Truth table0%0/4
A and not(B) and C
A= $self->{"self_contained"}B= not $self->{"exclude_vendor"}C= $App::cpanminus::script::Config{"vendorarch"}
ABCresult
0XX0
10X0
1100
1111
Truth table0%0/3
A and B
A= $stringB= $string =~ /^\.?\d/
ABresult
0X0
100
111
Truth table0%0/3
A and not(B)
A= $self->{"cpanfile_requirements"}B= not $dist->{"cpanfile"}
ABresult
0X0
100
111
Truth table0%0/3
A ||= B
A= $_[0]B= &Symbol::gensym()
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= defined $want_verB= length $want_ver
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $dist->{"distvname"}B= $dist->{"source"} eq "cpan"
ABresult
0X0
100
111
Truth table0%0/2
A
A= $ENV{'PERL_MM_OPT'}
Aresult
11
00
Truth table0%0/3
A or B
A= $provides->{$module_name}{"version"}B= $dist->{"version"}
ABresult
1X1
011
000
Truth table0%0/2
A
A= $self->{'scandeps_current'}
Aresult
11
00
Truth table0%0/3
A ||= B
A= $self->{"search_inc"}B= do { if (defined $main::Bin) { [grep((!m[^\Q$main::Bin\E/../(?:fat)?lib$]), @INC)]; } else { [@INC]; } }
ABresult
1X1
011
000
Truth table0%0/2
A
A= $dep->requires_version
Aresult
11
00
Truth table0%0/3
A and not(B)
A= -x $nameB= not -d _
ABresult
0X0
100
111
Truth table40%2/5
A or B and not(C)
A= -x $fullpathB= -x ($fullpath .= $exe_ext)C= not -d _
ABCresult
00X0
1X00
0100
1X11
0111
120 package ModuleBuildSkipMan;
121 CHECK {
122 if (%Module::Build::) {
123 no warnings 'redefine';
124 *Module::Build::Base::ACTION_manpages = sub {};
125 *Module::Build::Base::ACTION_docs = sub {};
126 }
127 }
128 1;
129 EOF
130 ! Configuring $distname failed. See $self->{log} for details.
131 ! You might have to install the following modules first to get --scandeps working correctly.
132 DIAG
133 APP_CPANMINUS_SCRIPT
134  
135 2 $fatpacked{"CPAN/DistnameInfo.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'CPAN_DISTNAMEINFO';
136 package CPAN::DistnameInfo;$VERSION="0.12";use strict;sub distname_info {my$file=shift or return;my ($dist,$version)=$file =~ /^
137 ((?:[-+.]*(?:[A-Za-z0-9]+|(?<=\D)_|_(?=\D))*
138 (?:
139 [A-Za-z](?=[^A-Za-z]|$)
140 |
141 \d(?=-)
142 )(?<![._-][vV])
143 )+)(.*)
144 $/xs or return ($file,undef,undef);if ($dist =~ /-undef\z/ and!length$version){$dist =~ s/-undef\z//}$version =~ s/-withoutworldwriteables$//;if ($version =~ /^(-[Vv].*)-(\d.*)/){$dist .= $1;$version=$2}if ($version =~ /(.+_.*)-(\d.*)/){$dist .= $1;$version=$2}$dist =~ s{\.pm$}{};$version=$1 if!length$version and $dist =~ s/-(\d+\w)$//;$version=$1 .$version if$version =~ /^\d+$/ and $dist =~ s/-(\w+)$//;if ($version =~ /\d\.\d/){$version =~ s/^[-_.]+//}else {$version =~ s/^[-_]+//}my$dev;if (length$version){if ($file =~ /^perl-?\d+\.(\d+)(?:\D(\d+))?(-(?:TRIAL|RC)\d+)?$/){$dev=1 if (($1 > 6 and $1 & 1)or ($2 and $2 >= 50))or $3}elsif ($version =~ /\d\D\d+_\d/ or $version =~ /-TRIAL/){$dev=1}}else {$version=undef}($dist,$version,$dev)}sub new {my$class=shift;my$distfile=shift;$distfile =~ s,//+,/,g;my%info=(pathname=>$distfile);($info{filename}=$distfile)=~ s,^(((.*?/)?authors/)?id/)?([A-Z])/(\4[A-Z])/(\5[-A-Z0-9]*)/,, and $info{cpanid}=$6;if ($distfile =~ m,([^/]+)\.(tar\.(?:g?z|bz2)|zip|tgz)$,i){$info{distvname}=$1;$info{extension}=$2}@info{qw(dist version beta)}=distname_info($info{distvname});$info{maturity}=delete$info{beta}? 'developer' : 'released';return bless \%info,$class}sub dist {shift->{dist}}sub version {shift->{version}}sub maturity {shift->{maturity}}sub filename {shift->{filename}}sub cpanid {shift->{cpanid}}sub distvname {shift->{distvname}}sub extension {shift->{extension}}sub pathname {shift->{pathname}}sub properties {%{$_[0]}}1;
145 CPAN_DISTNAMEINFO
146  
147 2 $fatpacked{"CPAN/Meta.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'CPAN_META';
148 0 ▶ use 5.006;use strict;use warnings;package CPAN::Meta;our$VERSION='2.150005';use Carp qw(carp croak);use CPAN::Meta::Feature;use CPAN::Meta::Prereqs;use CPAN::Meta::Converter;use CPAN::Meta::Validator;use Parse::CPAN::Meta 1.4414 ();BEGIN {*_dclone=\&CPAN::Meta::Converter::_dclone}BEGIN {my@STRING_READERS=qw(abstract description dynamic_config generated_by name release_status version);no strict 'refs';for my$attr (@STRING_READERS){*$attr=sub {$_[0]{$attr }}}}BEGIN {my@LIST_READERS=qw(author keywords license);no strict 'refs';for my$attr (@LIST_READERS){*$attr=sub {my$value=$_[0]{$attr };croak "$attr must be called in list context" unless wantarray;return @{_dclone($value)}if ref$value;return$value}}}sub authors {$_[0]->author}sub licenses {$_[0]->license}BEGIN {my@MAP_READERS=qw(meta-spec resources provides no_index prereqs optional_features);no strict 'refs';for my$attr (@MAP_READERS){(my$subname=$attr)=~ s/-/_/;*$subname=sub {my$value=$_[0]{$attr };return _dclone($value)if$value;return {}}}}sub custom_keys {return grep {/^x_/i}keys %{$_[0]}}sub custom {my ($self,$attr)=@_;my$value=$self->{$attr};return _dclone($value)if ref$value;return$value}sub _new {my ($class,$struct,$options)=@_;my$self;if ($options->{lazy_validation}){my$cmc=CPAN::Meta::Converter->new($struct);$self=$cmc->convert(version=>2);return bless$self,$class}else {my$cmv=CPAN::Meta::Validator->new($struct);unless ($cmv->is_valid){die "Invalid metadata structure. Errors: " .join(", ",$cmv->errors)."\n"}}my$version=$struct->{'meta-spec'}{version}|| '1.0';if ($version==2){$self=$struct}else {my$cmc=CPAN::Meta::Converter->new($struct);$self=$cmc->convert(version=>2)}return bless$self,$class}sub new {my ($class,$struct,$options)=@_;my$self=eval {$class->_new($struct,$options)};croak($@)if $@;return$self}sub create {my ($class,$struct,$options)=@_;my$version=__PACKAGE__->VERSION || 2;$struct->{generated_by}||= __PACKAGE__ ." version $version" ;$struct->{'meta-spec'}{version}||= int($version);my$self=eval {$class->_new($struct,$options)};croak ($@)if $@;return$self}sub load_file {my ($class,$file,$options)=@_;$options->{lazy_validation}=1 unless exists$options->{lazy_validation};croak "load_file() requires a valid, readable filename" unless -r $file;my$self;eval {my$struct=Parse::CPAN::Meta->load_file($file);$self=$class->_new($struct,$options)};croak($@)if $@;return$self}sub load_yaml_string {my ($class,$yaml,$options)=@_;$options->{lazy_validation}=1 unless exists$options->{lazy_validation};my$self;eval {my ($struct)=Parse::CPAN::Meta->load_yaml_string($yaml);$self=$class->_new($struct,$options)};croak($@)if $@;return$self}sub load_json_string {my ($class,$json,$options)=@_;$options->{lazy_validation}=1 unless exists$options->{lazy_validation};my$self;eval {my$struct=Parse::CPAN::Meta->load_json_string($json);$self=$class->_new($struct,$options)};croak($@)if $@;return$self}sub load_string {my ($class,$string,$options)=@_;$options->{lazy_validation}=1 unless exists$options->{lazy_validation};my$self;eval {my$struct=Parse::CPAN::Meta->load_string($string);$self=$class->_new($struct,$options)};croak($@)if $@;return$self}sub save {my ($self,$file,$options)=@_;my$version=$options->{version}|| '2';my$layer=$] ge '5.008001' ? ':utf8' : '';if ($version ge '2'){carp "'$file' should end in '.json'" unless$file =~ m{\.json$}}else {carp "'$file' should end in '.yml'" unless$file =~ m{\.yml$}}my$data=$self->as_string($options);open my$fh,">$layer",$file or die "Error opening '$file' for writing: $!\n";print {$fh}$data;close$fh or die "Error closing '$file': $!\n";return 1}sub meta_spec_version {my ($self)=@_;return$self->meta_spec->{version}}sub effective_prereqs {my ($self,$features)=@_;$features ||= [];my$prereq=CPAN::Meta::Prereqs->new($self->prereqs);return$prereq unless @$features;my@other=map {;$self->feature($_)->prereqs}@$features;return$prereq->with_merged_prereqs(\@other)}sub should_index_file {my ($self,$filename)=@_;for my$no_index_file (@{$self->no_index->{file}|| []}){return if$filename eq $no_index_file}for my$no_index_dir (@{$self->no_index->{directory}}){$no_index_dir =~ s{$}{/} unless$no_index_dir =~ m{/\z};return if index($filename,$no_index_dir)==0}return 1}sub should_index_package {my ($self,$package)=@_;for my$no_index_pkg (@{$self->no_index->{package}|| []}){return if$package eq $no_index_pkg}for my$no_index_ns (@{$self->no_index->{namespace}}){return if index($package,"${no_index_ns}::")==0}return 1}sub features {my ($self)=@_;my$opt_f=$self->optional_features;my@features=map {;CPAN::Meta::Feature->new($_=>$opt_f->{$_ })}keys %$opt_f;return@features}sub feature {my ($self,$ident)=@_;croak "no feature named $ident" unless my$f=$self->optional_features->{$ident };return CPAN::Meta::Feature->new($ident,$f)}sub as_struct {my ($self,$options)=@_;my$struct=_dclone($self);if ($options->{version}){my$cmc=CPAN::Meta::Converter->new($struct);$struct=$cmc->convert(version=>$options->{version})}return$struct}sub as_string {my ($self,$options)=@_;my$version=$options->{version}|| '2';my$struct;if ($self->meta_spec_version ne $version){my$cmc=CPAN::Meta::Converter->new($self->as_struct);$struct=$cmc->convert(version=>$version)}else {$struct=$self->as_struct}my ($data,$backend);if ($version ge '2'){$backend=Parse::CPAN::Meta->json_backend();local$struct->{x_serialization_backend}=sprintf '%s version %s',$backend,$backend->VERSION;$data=$backend->new->pretty->canonical->encode($struct)}else {$backend=Parse::CPAN::Meta->yaml_backend();local$struct->{x_serialization_backend}=sprintf '%s version %s',$backend,$backend->VERSION;$data=eval {no strict 'refs';&{"$backend\::Dump"}($struct)};if ($@){croak$backend->can('errstr')? $backend->errstr : $@}}return$data}sub TO_JSON {return {%{$_[0]}}}1;
Subroutine BEGIN: called CC=1 SCAR=3.5
Subroutine BEGIN: called CC=1 SCAR=3.5
Subroutine BEGIN: called CC=1 SCAR=3.5
Subroutine BEGIN: called CC=1 SCAR=3.5
Subroutine BEGIN: called CC=1 SCAR=3.5
Subroutine BEGIN: called CC=1 SCAR=3.5
Subroutine BEGIN: called CC=1 SCAR=3.5
Subroutine BEGIN: called CC=1 SCAR=3.5
Subroutine BEGIN: called CC=1 SCAR=3.5
Subroutine BEGIN: called CC=1 SCAR=3.5
Subroutine BEGIN: called CC=1 SCAR=3.5
Subroutine BEGIN: called CC=2 SCAR=13.1
Subroutine BEGIN: called CC=1 SCAR=3.5
Subroutine BEGIN: called CC=2 SCAR=13.1
Subroutine BEGIN: called CC=1 SCAR=3.5
Subroutine BEGIN: called CC=2 SCAR=13.1
Subroutine BEGIN: called CC=1 SCAR=3.5
Subroutine TO_JSON: called CC=1 SCAR=3.5
Subroutine __ANON__: not called CC=1 SCAR=3.5
Subroutine __ANON__: not called CC=3 SCAR=19.2
Subroutine __ANON__: not called CC=2 SCAR=13.1
Subroutine _new: called CC=5 SCAR=27.5
Subroutine as_string: not called CC=6 SCAR=30.6
Subroutine as_struct: called CC=2 SCAR=13.1
Subroutine authors: not called CC=1 SCAR=3.5
Subroutine create: not called CC=5 SCAR=27.5
Subroutine custom: not called CC=2 SCAR=13.1
Subroutine custom_keys: not called CC=1 SCAR=3.5
Subroutine effective_prereqs: not called CC=3 SCAR=19.2
Subroutine feature: not called CC=2 SCAR=13.1
Subroutine features: not called CC=1 SCAR=3.5
Subroutine licenses: not called CC=1 SCAR=3.5
Subroutine load_file: not called CC=4 SCAR=23.8
Subroutine load_json_string: called CC=3 SCAR=19.2
Subroutine load_string: not called CC=3 SCAR=19.2
Subroutine load_yaml_string: not called CC=3 SCAR=19.2
Subroutine meta_spec_version: not called CC=1 SCAR=3.5
Subroutine new: not called CC=2 SCAR=13.1
Subroutine save: not called CC=8 SCAR=35.6
Subroutine should_index_file: not called CC=7 SCAR=33.2
Subroutine should_index_package: not called CC=6 SCAR=30.6
Pod undocumented
Pod documented
Pod documented
Pod undocumented
Pod documented
Pod undocumented
Pod undocumented
Pod documented
Pod documented
Pod documented
Pod undocumented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Branch: 36 branches
BranchTrueFalseTotal
unless wantarray 0 0 0
if ref $value 0 0 0
if $value 0 0 0
if ($options->{'lazy_validation'}) { } 2 0 2
unless ($cmv->is_valid) 0 0 0
if ($version == 2) { } 0 0 0
if ($self->meta_spec_version ne $version) { } 0 0 0
if ($version ge '2') { } 0 0 0
if ($@) 0 0 0
$backend->can('errstr') ? : 0 0 0
if ($options->{"version"}) 0 2 2
if $@ 0 0 0
if ref $value 0 0 0
unless @$features 0 0 0
unless my $f = $self->optional_features->{$ident} 0 0 0
unless exists $options->{"lazy_validation"} 0 0 0
unless -r $file 0 0 0
if $@ 0 0 0
unless exists $options->{"lazy_validation"} 2 0 2
if $@ 0 2 2
unless exists $options->{"lazy_validation"} 0 0 0
if $@ 0 0 0
unless exists $options->{"lazy_validation"} 0 0 0
if $@ 0 0 0
if $@ 0 0 0
$] ge '5.008001' ? : 0 0 0
if ($version ge '2') { } 0 0 0
unless $file =~ /\.json$/ 0 0 0
unless $file =~ /\.yml$/ 0 0 0
open my $fh, ">$layer", $file or die "Error opening '${file}' for writing: $!\n" 0 0 0
close $fh or die "Error closing '${file}': $!\n" 0 0 0
if $filename eq $no_index_file 0 0 0
unless $no_index_dir =~ m[/\z] 0 0 0
if index($filename, $no_index_dir) == 0 0 0 0
if $package eq $no_index_pkg 0 0 0
if index($package, "${no_index_ns}::") == 0 0 0 0
Condition0%0/19
$struct->{'meta-spec'}{'version'} || '1.0'
l!l
00
$options->{'version'} || '2'
l!l
00
__PACKAGE__->VERSION || 2
l!l
00
$struct->{"generated_by"} ||= 'CPAN::Meta' . " version $version"
l!l
00
$struct->{"meta-spec"}{"version"} ||= int $version
l!l&&r!l&&!r
000
$features ||= []
l!l
00
$options->{'version'} || '2'
l!l
00
$self->no_index->{'file'} || []
l!l
00
$self->no_index->{'package'} || []
l!l
00
MC/DC0%0/1
$struct->{'meta-spec'}{'version'} || '1.0'
$struct->{'meta-spec'}{'version'}
MC/DC0%0/1
$options->{'version'} || '2'
$options->{'version'}
MC/DC0%0/1
__PACKAGE__->VERSION || 2
__PACKAGE__->VERSION
MC/DC0%0/1
$struct->{"generated_by"} ||= 'CPAN::Meta' . " version $version"
$struct->{"generated_by"}
MC/DC0%0/2
$struct->{"meta-spec"}{"version"} ||= int $version
$struct->{"meta-spec"}{"version"} int $version
MC/DC0%0/1
$features ||= []
$features
MC/DC0%0/1
$options->{'version'} || '2'
$options->{'version'}
MC/DC0%0/1
$self->no_index->{'file'} || []
$self->no_index->{'file'}
MC/DC0%0/1
$self->no_index->{'package'} || []
$self->no_index->{'package'}
Truth table0%0/2
A
A= $struct->{'meta-spec'}{'version'}
Aresult
11
00
Truth table0%0/2
A
A= $options->{'version'}
Aresult
11
00
Truth table0%0/2
A
A= __PACKAGE__->VERSION
Aresult
11
00
Truth table0%0/2
A
A= $struct->{"generated_by"}
Aresult
11
00
Truth table0%0/3
A ||= B
A= $struct->{"meta-spec"}{"version"}B= int $version
ABresult
1X1
011
000
Truth table0%0/2
A
A= $features
Aresult
11
00
Truth table0%0/2
A
A= $options->{'version'}
Aresult
11
00
Truth table0%0/2
A
A= $self->no_index->{'file'}
Aresult
11
00
Truth table0%0/2
A
A= $self->no_index->{'package'}
Aresult
11
00
149 CPAN_META
150  
151 2 $fatpacked{"CPAN/Meta/Check.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'CPAN_META_CHECK';
152 package CPAN::Meta::Check;$CPAN::Meta::Check::VERSION='0.018';use strict;use warnings;use base 'Exporter';our@EXPORT=qw//;our@EXPORT_OK=qw/check_requirements requirements_for verify_dependencies/;our%EXPORT_TAGS=(all=>[@EXPORT,@EXPORT_OK ]);use CPAN::Meta::Prereqs 2.132830;use CPAN::Meta::Requirements 2.121;use Module::Metadata 1.000023;sub _check_dep {my ($reqs,$module,$dirs)=@_;return$reqs->accepts_module($module,$])? (): sprintf "Your Perl (%s) is not in the range '%s'",$],$reqs->requirements_for_module($module)if$module eq 'perl';my$metadata=Module::Metadata->new_from_module($module,inc=>$dirs);return "Module '$module' is not installed" if not defined$metadata;my$version=eval {$metadata->version};return sprintf 'Installed version (%s) of %s is not in range \'%s\'',(defined$version ? $version : 'undef'),$module,$reqs->requirements_for_module($module)if not $reqs->accepts_module($module,$version || 0);return}sub _check_conflict {my ($reqs,$module,$dirs)=@_;my$metadata=Module::Metadata->new_from_module($module,inc=>$dirs);return if not defined$metadata;my$version=eval {$metadata->version};return sprintf 'Installed version (%s) of %s is in range \'%s\'',(defined$version ? $version : 'undef'),$module,$reqs->requirements_for_module($module)if$reqs->accepts_module($module,$version);return}sub requirements_for {my ($meta,$phases,$type)=@_;my$prereqs=ref($meta)eq 'CPAN::Meta' ? $meta->effective_prereqs : $meta;return$prereqs->merged_requirements(ref($phases)? $phases : [$phases ],[$type ])}sub check_requirements {my ($reqs,$type,$dirs)=@_;return +{map {$_=>$type ne 'conflicts' ? scalar _check_dep($reqs,$_,$dirs): scalar _check_conflict($reqs,$_,$dirs)}$reqs->required_modules }}sub verify_dependencies {my ($meta,$phases,$type,$dirs)=@_;my$reqs=requirements_for($meta,$phases,$type);my$issues=check_requirements($reqs,$type,$dirs);return grep {defined}values %{$issues}}1;
153 CPAN_META_CHECK
154  
155 2 $fatpacked{"CPAN/Meta/Converter.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'CPAN_META_CONVERTER';
156 0 ▶ use 5.006;use strict;use warnings;package CPAN::Meta::Converter;our$VERSION='2.150005';use CPAN::Meta::Validator;use CPAN::Meta::Requirements;use Parse::CPAN::Meta 1.4400 ();BEGIN {eval "use version ()";if (my$err=$@){eval "use ExtUtils::MakeMaker::version" or die$err}}*_is_qv=version->can('is_qv')? sub {$_[0]->is_qv}: sub {exists $_[0]->{qv}};sub _dclone {my$ref=shift;no warnings 'once';no warnings 'redefine';local*UNIVERSAL::TO_JSON=sub {"$_[0]"};my$json=Parse::CPAN::Meta->json_backend()->new ->utf8 ->allow_blessed ->convert_blessed;$json->decode($json->encode($ref))}my%known_specs=('2'=>'http://search.cpan.org/perldoc?CPAN::Meta::Spec','1.4'=>'http://module-build.sourceforge.net/META-spec-v1.4.html','1.3'=>'http://module-build.sourceforge.net/META-spec-v1.3.html','1.2'=>'http://module-build.sourceforge.net/META-spec-v1.2.html','1.1'=>'http://module-build.sourceforge.net/META-spec-v1.1.html','1.0'=>'http://module-build.sourceforge.net/META-spec-v1.0.html');my@spec_list=sort {$a <=> $b}keys%known_specs;my ($LOWEST,$HIGHEST)=@spec_list[0,-1];sub _keep {$_[0]}sub _keep_or_one {defined($_[0])? $_[0]: 1}sub _keep_or_zero {defined($_[0])? $_[0]: 0}sub _keep_or_unknown {defined($_[0])&& length($_[0])? $_[0]: "unknown"}sub _generated_by {my$gen=shift;my$sig=__PACKAGE__ ." version " .(__PACKAGE__->VERSION || "<dev>");return$sig unless defined$gen and length$gen;return$gen if$gen =~ /\Q$sig/;return "$gen, $sig"}sub _listify {!defined $_[0]? undef : ref $_[0]eq 'ARRAY' ? $_[0]: [$_[0]]}sub _prefix_custom {my$key=shift;$key =~ s/^(?!x_) # Unless it already starts with x_
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine BEGIN: called CC=3 SCAR=11.4
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine __ANON__: called CC=1 SCAR=0.1
Subroutine __ANON__: not called CC=1 SCAR=0.1
Subroutine _dclone: called CC=1 SCAR=0.1
Subroutine _generated_by: called CC=5 SCAR=16.8
Subroutine _keep: called CC=1 SCAR=0.1
Subroutine _keep_or_one: called CC=2 SCAR=7.2
Subroutine _keep_or_unknown: called CC=3 SCAR=11.4
Subroutine _keep_or_zero: not called CC=2 SCAR=7.2
Subroutine _listify: called CC=3 SCAR=11.4
Subroutine _prefix_custom: called CC=1 SCAR=2.1
Branch: 9 branches
BranchTrueFalseTotal
if (my $err = $@) 0 2 2
eval "use ExtUtils::MakeMaker::version" or die $err 0 0 0
unless defined $gen and length $gen 0 2 2
if $gen =~ /\Q$sig\E/ 0 2 2
defined $_[0] ? : 2 0 2
defined $_[0] && length $_[0] ? : 2 0 2
defined $_[0] ? : 0 0 0
!defined($_[0]) ? : 6 4 10
ref $_[0] eq 'ARRAY' ? : 4 0 4
Condition37%3/8
__PACKAGE__->VERSION || '<dev>'
l!l
20
defined $gen and length $gen
!ll&&!rl&&r
002
defined $_[0] and length $_[0]
!ll&&!rl&&r
002
MC/DC0%0/1
__PACKAGE__->VERSION || '<dev>'
__PACKAGE__->VERSION
MC/DC0%0/2
defined $gen and length $gen
defined $gen length $gen
MC/DC0%0/2
defined $_[0] and length $_[0]
defined $_[0] length $_[0]
Truth table50%1/2
A
A= __PACKAGE__->VERSION
Aresult
11
00
Truth table33%1/3
A and B
A= defined $genB= length $gen
ABresult
0X0
100
111
Truth table33%1/3
A and B
A= defined $_[0]B= length $_[0]
ABresult
0X0
100
111
157 (?:x-?)? # Remove leading x- or x (if present)
158 0 ▶ /x_/ix;return$key}sub _ucfirst_custom {my$key=shift;$key=ucfirst$key unless$key =~ /[A-Z]/;return$key}sub _no_prefix_ucfirst_custom {my$key=shift;$key =~ s/^x_//;return _ucfirst_custom($key)}sub _change_meta_spec {my ($element,undef,undef,$version)=@_;return {version=>$version,url=>$known_specs{$version},}}my@open_source=('perl','gpl','apache','artistic','artistic_2','lgpl','bsd','gpl','mit','mozilla','open_source',);my%is_open_source=map {;$_=>1}@open_source;my@valid_licenses_1=(@open_source,'unrestricted','restrictive','unknown',);my%license_map_1=((map {$_=>$_}@valid_licenses_1),artistic2=>'artistic_2',);sub _license_1 {my ($element)=@_;return 'unknown' unless defined$element;if ($license_map_1{lc$element}){return$license_map_1{lc$element}}else {return 'unknown'}}my@valid_licenses_2=qw(agpl_3 apache_1_1 apache_2_0 artistic_1 artistic_2 bsd freebsd gfdl_1_2 gfdl_1_3 gpl_1 gpl_2 gpl_3 lgpl_2_1 lgpl_3_0 mit mozilla_1_0 mozilla_1_1 openssl perl_5 qpl_1_0 ssleay sun zlib open_source restricted unrestricted unknown);my%license_map_2=((map {$_=>$_}@valid_licenses_2),apache=>'apache_2_0',artistic=>'artistic_1',artistic2=>'artistic_2',gpl=>'open_source',lgpl=>'open_source',mozilla=>'open_source',perl=>'perl_5',restrictive=>'restricted',);sub _license_2 {my ($element)=@_;return ['unknown' ]unless defined$element;$element=[$element ]unless ref$element eq 'ARRAY';my@new_list;for my$lic (@$element){next unless defined$lic;if (my$new=$license_map_2{lc$lic}){push@new_list,$new}}return@new_list ? \@new_list : ['unknown' ]}my%license_downgrade_map=qw(agpl_3 open_source apache_1_1 apache apache_2_0 apache artistic_1 artistic artistic_2 artistic_2 bsd bsd freebsd open_source gfdl_1_2 open_source gfdl_1_3 open_source gpl_1 gpl gpl_2 gpl gpl_3 gpl lgpl_2_1 lgpl lgpl_3_0 lgpl mit mit mozilla_1_0 mozilla mozilla_1_1 mozilla openssl open_source perl_5 perl qpl_1_0 open_source ssleay open_source sun open_source zlib open_source open_source open_source restricted restrictive unrestricted unrestricted unknown unknown);sub _downgrade_license {my ($element)=@_;if (!defined$element){return "unknown"}elsif(ref$element eq 'ARRAY'){if (@$element > 1){if (grep {!$is_open_source{$license_downgrade_map{lc $_}|| 'unknown' }}@$element){return 'unknown'}else {return 'open_source'}}elsif (@$element==1){return$license_downgrade_map{lc$element->[0]}|| "unknown"}}elsif (!ref$element){return$license_downgrade_map{lc$element}|| "unknown"}return "unknown"}my$no_index_spec_1_2={'file'=>\&_listify,'dir'=>\&_listify,'package'=>\&_listify,'namespace'=>\&_listify,};my$no_index_spec_1_3={'file'=>\&_listify,'directory'=>\&_listify,'package'=>\&_listify,'namespace'=>\&_listify,};my$no_index_spec_2={'file'=>\&_listify,'directory'=>\&_listify,'package'=>\&_listify,'namespace'=>\&_listify,':custom'=>\&_prefix_custom,};sub _no_index_1_2 {my (undef,undef,$meta)=@_;my$no_index=$meta->{no_index}|| $meta->{private};return unless$no_index;if (!ref$no_index){my$item=$no_index;$no_index={dir=>[$item ],file=>[$item ]}}elsif (ref$no_index eq 'ARRAY'){my$list=$no_index;$no_index={dir=>[@$list ],file=>[@$list ]}}if (exists$no_index->{files}){$no_index->{file}=delete$no_index->{files}}if (exists$no_index->{modules}){$no_index->{module}=delete$no_index->{modules}}return _convert($no_index,$no_index_spec_1_2)}sub _no_index_directory {my ($element,$key,$meta,$version)=@_;return unless$element;if (!ref$element){my$item=$element;$element={directory=>[$item ],file=>[$item ]}}elsif (ref$element eq 'ARRAY'){my$list=$element;$element={directory=>[@$list ],file=>[@$list ]}}if (exists$element->{dir}){$element->{directory}=delete$element->{dir}}if (exists$element->{files}){$element->{file}=delete$element->{files}}if (exists$element->{modules}){$element->{module}=delete$element->{modules}}my$spec=$version==2 ? $no_index_spec_2 : $no_index_spec_1_3;return _convert($element,$spec)}sub _is_module_name {my$mod=shift;return unless defined$mod && length$mod;return$mod =~ m{^[A-Za-z][A-Za-z0-9_]*(?:::[A-Za-z0-9_]+)*$}}sub _clean_version {my ($element)=@_;return 0 if!defined$element;$element =~ s{^\s*}{};$element =~ s{\s*$}{};$element =~ s{^\.}{0.};return 0 if!length$element;return 0 if ($element eq 'undef' || $element eq '<undef>');my$v=eval {version->new($element)};if (defined$v){return _is_qv($v)? $v->normal : $element}else {return 0}}sub _bad_version_hook {my ($v)=@_;$v =~ s{^\s*}{};$v =~ s{\s*$}{};$v =~ s{[a-z]+$}{};my$vobj=eval {version->new($v)};return defined($vobj)? $vobj : version->new(0)}sub _version_map {my ($element)=@_;return unless defined$element;if (ref$element eq 'HASH'){my$new_map=CPAN::Meta::Requirements->new({bad_version_hook=>\&_bad_version_hook });while (my ($k,$v)=each %$element){next unless _is_module_name($k);if (!defined($v)||!length($v)|| $v eq 'undef' || $v eq '<undef>'){$v=0}if (_is_module_name($v)&&!version::is_lax($v)){$new_map->add_minimum($k=>0);$new_map->add_minimum($v=>0)}$new_map->add_string_requirement($k=>$v)}return$new_map->as_string_hash}elsif (ref$element eq 'ARRAY'){my$hashref={map {$_=>0}@$element };return _version_map($hashref)}elsif (ref$element eq '' && length$element){return {$element=>0 }}return}sub _prereqs_from_1 {my (undef,undef,$meta)=@_;my$prereqs={};for my$phase (qw/build configure/){my$key="${phase}_requires";$prereqs->{$phase}{requires}=_version_map($meta->{$key})if$meta->{$key}}for my$rel (qw/requires recommends conflicts/){$prereqs->{runtime}{$rel}=_version_map($meta->{$rel})if$meta->{$rel}}return$prereqs}my$prereqs_spec={configure=>\&_prereqs_rel,build=>\&_prereqs_rel,test=>\&_prereqs_rel,runtime=>\&_prereqs_rel,develop=>\&_prereqs_rel,':custom'=>\&_prefix_custom,};my$relation_spec={requires=>\&_version_map,recommends=>\&_version_map,suggests=>\&_version_map,conflicts=>\&_version_map,':custom'=>\&_prefix_custom,};sub _cleanup_prereqs {my ($prereqs,$key,$meta,$to_version)=@_;return unless$prereqs && ref$prereqs eq 'HASH';return _convert($prereqs,$prereqs_spec,$to_version)}sub _prereqs_rel {my ($relation,$key,$meta,$to_version)=@_;return unless$relation && ref$relation eq 'HASH';return _convert($relation,$relation_spec,$to_version)}BEGIN {my@old_prereqs=qw(requires configure_requires recommends conflicts);for (@old_prereqs){my$sub="_get_$_";my ($phase,$type)=split qr/_/,$_;if (!defined$type){$type=$phase;$phase='runtime'}no strict 'refs';*{$sub}=sub {_extract_prereqs($_[2]->{prereqs},$phase,$type)}}}sub _get_build_requires {my ($data,$key,$meta)=@_;my$test_h=_extract_prereqs($_[2]->{prereqs},qw(test requires))|| {};my$build_h=_extract_prereqs($_[2]->{prereqs},qw(build requires))|| {};my$test_req=CPAN::Meta::Requirements->from_string_hash($test_h);my$build_req=CPAN::Meta::Requirements->from_string_hash($build_h);$test_req->add_requirements($build_req)->as_string_hash}sub _extract_prereqs {my ($prereqs,$phase,$type)=@_;return unless ref$prereqs eq 'HASH';return scalar _version_map($prereqs->{$phase}{$type})}sub _downgrade_optional_features {my (undef,undef,$meta)=@_;return unless exists$meta->{optional_features};my$origin=$meta->{optional_features};my$features={};for my$name (keys %$origin){$features->{$name}={description=>$origin->{$name}{description},requires=>_extract_prereqs($origin->{$name}{prereqs},'runtime','requires'),configure_requires=>_extract_prereqs($origin->{$name}{prereqs},'runtime','configure_requires'),build_requires=>_extract_prereqs($origin->{$name}{prereqs},'runtime','build_requires'),recommends=>_extract_prereqs($origin->{$name}{prereqs},'runtime','recommends'),conflicts=>_extract_prereqs($origin->{$name}{prereqs},'runtime','conflicts'),};for my$k (keys %{$features->{$name}}){delete$features->{$name}{$k}unless defined$features->{$name}{$k}}}return$features}sub _upgrade_optional_features {my (undef,undef,$meta)=@_;return unless exists$meta->{optional_features};my$origin=$meta->{optional_features};my$features={};for my$name (keys %$origin){$features->{$name}={description=>$origin->{$name}{description},prereqs=>_prereqs_from_1(undef,undef,$origin->{$name}),};delete$features->{$name}{prereqs}{configure}}return$features}my$optional_features_2_spec={description=>\&_keep,prereqs=>\&_cleanup_prereqs,':custom'=>\&_prefix_custom,};sub _feature_2 {my ($element,$key,$meta,$to_version)=@_;return unless$element && ref$element eq 'HASH';_convert($element,$optional_features_2_spec,$to_version)}sub _cleanup_optional_features_2 {my ($element,$key,$meta,$to_version)=@_;return unless$element && ref$element eq 'HASH';my$new_data={};for my$k (keys %$element){$new_data->{$k}=_feature_2($element->{$k},$k,$meta,$to_version)}return unless keys %$new_data;return$new_data}sub _optional_features_1_4 {my ($element)=@_;return unless$element;$element=_optional_features_as_map($element);for my$name (keys %$element){for my$drop (qw/requires_packages requires_os excluded_os/){delete$element->{$name}{$drop}}}return$element}sub _optional_features_as_map {my ($element)=@_;return unless$element;if (ref$element eq 'ARRAY'){my%map;for my$feature (@$element){my (@parts)=%$feature;$map{$parts[0]}=$parts[1]}$element=\%map}return$element}sub _is_urlish {defined $_[0]&& $_[0]=~ m{\A[-+.a-z0-9]+:.+}i}sub _url_or_drop {my ($element)=@_;return$element if _is_urlish($element);return}sub _url_list {my ($element)=@_;return unless$element;$element=_listify($element);$element=[grep {_is_urlish($_)}@$element ];return unless @$element;return$element}sub _author_list {my ($element)=@_;return ['unknown' ]unless$element;$element=_listify($element);$element=[map {defined $_ && length $_ ? $_ : 'unknown'}@$element ];return ['unknown' ]unless @$element;return$element}my$resource2_upgrade={license=>sub {return _is_urlish($_[0])? _listify($_[0]): undef},homepage=>\&_url_or_drop,bugtracker=>sub {my ($item)=@_;return unless$item;if ($item =~ m{^mailto:(.*)$}){return {mailto=>$1 }}elsif(_is_urlish($item)){return {web=>$item }}else {return}},repository=>sub {return _is_urlish($_[0])? {url=>$_[0]}: undef},':custom'=>\&_prefix_custom,};sub _upgrade_resources_2 {my (undef,undef,$meta,$version)=@_;return unless exists$meta->{resources};return _convert($meta->{resources},$resource2_upgrade)}my$bugtracker2_spec={web=>\&_url_or_drop,mailto=>\&_keep,':custom'=>\&_prefix_custom,};sub _repo_type {my ($element,$key,$meta,$to_version)=@_;return$element if defined$element;return unless exists$meta->{url};my$repo_url=$meta->{url};for my$type (qw/git svn/){return$type if$repo_url =~ m{\A$type}}return}my$repository2_spec={web=>\&_url_or_drop,url=>\&_url_or_drop,type=>\&_repo_type,':custom'=>\&_prefix_custom,};my$resources2_cleanup={license=>\&_url_list,homepage=>\&_url_or_drop,bugtracker=>sub {ref $_[0]? _convert($_[0],$bugtracker2_spec): undef},repository=>sub {my$data=shift;ref$data ? _convert($data,$repository2_spec): undef},':custom'=>\&_prefix_custom,};sub _cleanup_resources_2 {my ($resources,$key,$meta,$to_version)=@_;return unless$resources && ref$resources eq 'HASH';return _convert($resources,$resources2_cleanup,$to_version)}my$resource1_spec={license=>\&_url_or_drop,homepage=>\&_url_or_drop,bugtracker=>\&_url_or_drop,repository=>\&_url_or_drop,':custom'=>\&_keep,};sub _resources_1_3 {my (undef,undef,$meta,$version)=@_;return unless exists$meta->{resources};return _convert($meta->{resources},$resource1_spec)}*_resources_1_4=*_resources_1_3;sub _resources_1_2 {my (undef,undef,$meta)=@_;my$resources=$meta->{resources}|| {};if ($meta->{license_url}&&!$resources->{license}){$resources->{license}=$meta->{license_url}if _is_urlish($meta->{license_url})}return unless keys %$resources;return _convert($resources,$resource1_spec)}my$resource_downgrade_spec={license=>sub {return ref $_[0]? $_[0]->[0]: $_[0]},homepage=>\&_url_or_drop,bugtracker=>sub {return $_[0]->{web}},repository=>sub {return $_[0]->{url}|| $_[0]->{web}},':custom'=>\&_no_prefix_ucfirst_custom,};sub _downgrade_resources {my (undef,undef,$meta,$version)=@_;return unless exists$meta->{resources};return _convert($meta->{resources},$resource_downgrade_spec)}sub _release_status {my ($element,undef,$meta)=@_;return$element if$element && $element =~ m{\A(?:stable|testing|unstable)\z};return _release_status_from_version(undef,undef,$meta)}sub _release_status_from_version {my (undef,undef,$meta)=@_;my$version=$meta->{version}|| '';return ($version =~ /_/)? 'testing' : 'stable'}my$provides_spec={file=>\&_keep,version=>\&_keep,};my$provides_spec_2={file=>\&_keep,version=>\&_keep,':custom'=>\&_prefix_custom,};sub _provides {my ($element,$key,$meta,$to_version)=@_;return unless defined$element && ref$element eq 'HASH';my$spec=$to_version==2 ? $provides_spec_2 : $provides_spec;my$new_data={};for my$k (keys %$element){$new_data->{$k}=_convert($element->{$k},$spec,$to_version);$new_data->{$k}{version}=_clean_version($element->{$k}{version})if exists$element->{$k}{version}}return$new_data}sub _convert {my ($data,$spec,$to_version,$is_fragment)=@_;my$new_data={};for my$key (keys %$spec){next if$key eq ':custom' || $key eq ':drop';next unless my$fcn=$spec->{$key};if ($is_fragment && $key eq 'generated_by'){$fcn=\&_keep}die "spec for '$key' is not a coderef" unless ref$fcn && ref$fcn eq 'CODE';my$new_value=$fcn->($data->{$key},$key,$data,$to_version);$new_data->{$key}=$new_value if defined$new_value}my$drop_list=$spec->{':drop'};my$customizer=$spec->{':custom'}|| \&_keep;for my$key (keys %$data){next if$drop_list && grep {$key eq $_}@$drop_list;next if exists$spec->{$key};$new_data->{$customizer->($key)}=$data->{$key}}return$new_data}my%up_convert=('2-from-1.4'=>{'abstract'=>\&_keep_or_unknown,'author'=>\&_author_list,'generated_by'=>\&_generated_by,'license'=>\&_license_2,'meta-spec'=>\&_change_meta_spec,'name'=>\&_keep,'version'=>\&_keep,'dynamic_config'=>\&_keep_or_one,'release_status'=>\&_release_status,'keywords'=>\&_keep,'no_index'=>\&_no_index_directory,'optional_features'=>\&_upgrade_optional_features,'provides'=>\&_provides,'resources'=>\&_upgrade_resources_2,'description'=>\&_keep,'prereqs'=>\&_prereqs_from_1,':drop'=>[qw(build_requires configure_requires conflicts distribution_type license_url private recommends requires) ],':custom'=>\&_prefix_custom,},'1.4-from-1.3'=>{'abstract'=>\&_keep_or_unknown,'author'=>\&_author_list,'generated_by'=>\&_generated_by,'license'=>\&_license_1,'meta-spec'=>\&_change_meta_spec,'name'=>\&_keep,'version'=>\&_keep,'build_requires'=>\&_version_map,'conflicts'=>\&_version_map,'distribution_type'=>\&_keep,'dynamic_config'=>\&_keep_or_one,'keywords'=>\&_keep,'no_index'=>\&_no_index_directory,'optional_features'=>\&_optional_features_1_4,'provides'=>\&_provides,'recommends'=>\&_version_map,'requires'=>\&_version_map,'resources'=>\&_resources_1_4,'configure_requires'=>\&_keep,':drop'=>[qw(license_url private)],':custom'=>\&_keep },'1.3-from-1.2'=>{'abstract'=>\&_keep_or_unknown,'author'=>\&_author_list,'generated_by'=>\&_generated_by,'license'=>\&_license_1,'meta-spec'=>\&_change_meta_spec,'name'=>\&_keep,'version'=>\&_keep,'build_requires'=>\&_version_map,'conflicts'=>\&_version_map,'distribution_type'=>\&_keep,'dynamic_config'=>\&_keep_or_one,'keywords'=>\&_keep,'no_index'=>\&_no_index_directory,'optional_features'=>\&_optional_features_as_map,'provides'=>\&_provides,'recommends'=>\&_version_map,'requires'=>\&_version_map,'resources'=>\&_resources_1_3,':drop'=>[qw(license_url private)],':custom'=>\&_keep },'1.2-from-1.1'=>{'version'=>\&_keep,'license'=>\&_license_1,'name'=>\&_keep,'generated_by'=>\&_generated_by,'abstract'=>\&_keep_or_unknown,'author'=>\&_author_list,'meta-spec'=>\&_change_meta_spec,'build_requires'=>\&_version_map,'conflicts'=>\&_version_map,'distribution_type'=>\&_keep,'dynamic_config'=>\&_keep_or_one,'recommends'=>\&_version_map,'requires'=>\&_version_map,'keywords'=>\&_keep,'no_index'=>\&_no_index_1_2,'optional_features'=>\&_optional_features_as_map,'provides'=>\&_provides,'resources'=>\&_resources_1_2,':drop'=>[qw(license_url private)],':custom'=>\&_keep },'1.1-from-1.0'=>{'version'=>\&_keep,'name'=>\&_keep,'build_requires'=>\&_version_map,'conflicts'=>\&_version_map,'distribution_type'=>\&_keep,'dynamic_config'=>\&_keep_or_one,'generated_by'=>\&_generated_by,'license'=>\&_license_1,'recommends'=>\&_version_map,'requires'=>\&_version_map,'license_url'=>\&_url_or_drop,'private'=>\&_keep,':custom'=>\&_keep },);my%down_convert=('1.4-from-2'=>{'abstract'=>\&_keep_or_unknown,'author'=>\&_author_list,'generated_by'=>\&_generated_by,'license'=>\&_downgrade_license,'meta-spec'=>\&_change_meta_spec,'name'=>\&_keep,'version'=>\&_keep,'build_requires'=>\&_get_build_requires,'configure_requires'=>\&_get_configure_requires,'conflicts'=>\&_get_conflicts,'distribution_type'=>\&_keep,'dynamic_config'=>\&_keep_or_one,'keywords'=>\&_keep,'no_index'=>\&_no_index_directory,'optional_features'=>\&_downgrade_optional_features,'provides'=>\&_provides,'recommends'=>\&_get_recommends,'requires'=>\&_get_requires,'resources'=>\&_downgrade_resources,':drop'=>[qw(description prereqs release_status)],':custom'=>\&_keep },'1.3-from-1.4'=>{'abstract'=>\&_keep_or_unknown,'author'=>\&_author_list,'generated_by'=>\&_generated_by,'license'=>\&_license_1,'meta-spec'=>\&_change_meta_spec,'name'=>\&_keep,'version'=>\&_keep,'build_requires'=>\&_version_map,'conflicts'=>\&_version_map,'distribution_type'=>\&_keep,'dynamic_config'=>\&_keep_or_one,'keywords'=>\&_keep,'no_index'=>\&_no_index_directory,'optional_features'=>\&_optional_features_as_map,'provides'=>\&_provides,'recommends'=>\&_version_map,'requires'=>\&_version_map,'resources'=>\&_resources_1_3,':drop'=>[qw(configure_requires)],':custom'=>\&_keep,},'1.2-from-1.3'=>{'abstract'=>\&_keep_or_unknown,'author'=>\&_author_list,'generated_by'=>\&_generated_by,'license'=>\&_license_1,'meta-spec'=>\&_change_meta_spec,'name'=>\&_keep,'version'=>\&_keep,'build_requires'=>\&_version_map,'conflicts'=>\&_version_map,'distribution_type'=>\&_keep,'dynamic_config'=>\&_keep_or_one,'keywords'=>\&_keep,'no_index'=>\&_no_index_1_2,'optional_features'=>\&_optional_features_as_map,'provides'=>\&_provides,'recommends'=>\&_version_map,'requires'=>\&_version_map,'resources'=>\&_resources_1_3,':custom'=>\&_keep,},'1.1-from-1.2'=>{'version'=>\&_keep,'name'=>\&_keep,'meta-spec'=>\&_change_meta_spec,'build_requires'=>\&_version_map,'conflicts'=>\&_version_map,'distribution_type'=>\&_keep,'dynamic_config'=>\&_keep_or_one,'generated_by'=>\&_generated_by,'license'=>\&_license_1,'private'=>\&_keep,'recommends'=>\&_version_map,'requires'=>\&_version_map,':drop'=>[qw(abstract author provides no_index keywords resources)],':custom'=>\&_keep,},'1.0-from-1.1'=>{'name'=>\&_keep,'meta-spec'=>\&_change_meta_spec,'version'=>\&_keep,'build_requires'=>\&_version_map,'conflicts'=>\&_version_map,'distribution_type'=>\&_keep,'dynamic_config'=>\&_keep_or_one,'generated_by'=>\&_generated_by,'license'=>\&_license_1,'recommends'=>\&_version_map,'requires'=>\&_version_map,':custom'=>\&_keep,},);my%cleanup=('2'=>{'abstract'=>\&_keep_or_unknown,'author'=>\&_author_list,'generated_by'=>\&_generated_by,'license'=>\&_license_2,'meta-spec'=>\&_change_meta_spec,'name'=>\&_keep,'version'=>\&_keep,'dynamic_config'=>\&_keep_or_one,'release_status'=>\&_release_status,'keywords'=>\&_keep,'no_index'=>\&_no_index_directory,'optional_features'=>\&_cleanup_optional_features_2,'provides'=>\&_provides,'resources'=>\&_cleanup_resources_2,'description'=>\&_keep,'prereqs'=>\&_cleanup_prereqs,':drop'=>[qw(build_requires configure_requires conflicts distribution_type license_url private recommends requires) ],':custom'=>\&_prefix_custom,},'1.4'=>{'abstract'=>\&_keep_or_unknown,'author'=>\&_author_list,'generated_by'=>\&_generated_by,'license'=>\&_license_1,'meta-spec'=>\&_change_meta_spec,'name'=>\&_keep,'version'=>\&_keep,'build_requires'=>\&_version_map,'conflicts'=>\&_version_map,'distribution_type'=>\&_keep,'dynamic_config'=>\&_keep_or_one,'keywords'=>\&_keep,'no_index'=>\&_no_index_directory,'optional_features'=>\&_optional_features_1_4,'provides'=>\&_provides,'recommends'=>\&_version_map,'requires'=>\&_version_map,'resources'=>\&_resources_1_4,'configure_requires'=>\&_keep,':custom'=>\&_keep },'1.3'=>{'abstract'=>\&_keep_or_unknown,'author'=>\&_author_list,'generated_by'=>\&_generated_by,'license'=>\&_license_1,'meta-spec'=>\&_change_meta_spec,'name'=>\&_keep,'version'=>\&_keep,'build_requires'=>\&_version_map,'conflicts'=>\&_version_map,'distribution_type'=>\&_keep,'dynamic_config'=>\&_keep_or_one,'keywords'=>\&_keep,'no_index'=>\&_no_index_directory,'optional_features'=>\&_optional_features_as_map,'provides'=>\&_provides,'recommends'=>\&_version_map,'requires'=>\&_version_map,'resources'=>\&_resources_1_3,':custom'=>\&_keep },'1.2'=>{'version'=>\&_keep,'license'=>\&_license_1,'name'=>\&_keep,'generated_by'=>\&_generated_by,'abstract'=>\&_keep_or_unknown,'author'=>\&_author_list,'meta-spec'=>\&_change_meta_spec,'build_requires'=>\&_version_map,'conflicts'=>\&_version_map,'distribution_type'=>\&_keep,'dynamic_config'=>\&_keep_or_one,'recommends'=>\&_version_map,'requires'=>\&_version_map,'keywords'=>\&_keep,'no_index'=>\&_no_index_1_2,'optional_features'=>\&_optional_features_as_map,'provides'=>\&_provides,'resources'=>\&_resources_1_2,':custom'=>\&_keep },'1.1'=>{'version'=>\&_keep,'name'=>\&_keep,'meta-spec'=>\&_change_meta_spec,'build_requires'=>\&_version_map,'conflicts'=>\&_version_map,'distribution_type'=>\&_keep,'dynamic_config'=>\&_keep_or_one,'generated_by'=>\&_generated_by,'license'=>\&_license_1,'recommends'=>\&_version_map,'requires'=>\&_version_map,'license_url'=>\&_url_or_drop,'private'=>\&_keep,':custom'=>\&_keep },'1.0'=>{'name'=>\&_keep,'meta-spec'=>\&_change_meta_spec,'version'=>\&_keep,'build_requires'=>\&_version_map,'conflicts'=>\&_version_map,'distribution_type'=>\&_keep,'dynamic_config'=>\&_keep_or_one,'generated_by'=>\&_generated_by,'license'=>\&_license_1,'recommends'=>\&_version_map,'requires'=>\&_version_map,':custom'=>\&_keep,},);my%fragments_generate=('2'=>{'abstract'=>'abstract','author'=>'author','generated_by'=>'generated_by','license'=>'license','name'=>'name','version'=>'version','dynamic_config'=>'dynamic_config','release_status'=>'release_status','keywords'=>'keywords','no_index'=>'no_index','optional_features'=>'optional_features','provides'=>'provides','resources'=>'resources','description'=>'description','prereqs'=>'prereqs',},'1.4'=>{'abstract'=>'abstract','author'=>'author','generated_by'=>'generated_by','license'=>'license','name'=>'name','version'=>'version','build_requires'=>'prereqs','conflicts'=>'prereqs','distribution_type'=>'distribution_type','dynamic_config'=>'dynamic_config','keywords'=>'keywords','no_index'=>'no_index','optional_features'=>'optional_features','provides'=>'provides','recommends'=>'prereqs','requires'=>'prereqs','resources'=>'resources','configure_requires'=>'prereqs',},);$fragments_generate{$_}=$fragments_generate{'1.4'}for qw/1.3 1.2 1.1 1.0/;sub new {my ($class,$data,%args)=@_;my$self={'data'=>$data,'spec'=>_extract_spec_version($data,$args{default_version}),};return bless$self,$class}sub _extract_spec_version {my ($data,$default)=@_;my$spec=$data->{'meta-spec'};return($default || "1.0")unless defined$spec && ref$spec eq 'HASH';my$v=$spec->{version};if (defined$v && $v =~ /^\d+(?:\.\d+)?$/){return$v if defined$v && grep {$v eq $_}keys%known_specs;return$v+0 if defined$v && grep {$v==$_}keys%known_specs}return "2" if exists$data->{prereqs};return "1.4" if exists$data->{configure_requires};return($default || "1.2")}sub convert {my ($self,%args)=@_;my$args={%args };my$new_version=$args->{version}|| $HIGHEST;my$is_fragment=$args->{is_fragment};my ($old_version)=$self->{spec};my$converted=_dclone($self->{data});if ($old_version==$new_version){$converted=_convert($converted,$cleanup{$old_version},$old_version,$is_fragment);unless ($args->{is_fragment}){my$cmv=CPAN::Meta::Validator->new($converted);unless ($cmv->is_valid){my$errs=join("\n",$cmv->errors);die "Failed to clean-up $old_version metadata. Errors:\n$errs\n"}}return$converted}elsif ($old_version > $new_version){my@vers=sort {$b <=> $a}keys%known_specs;for my$i (0 .. $#vers-1){next if$vers[$i]> $old_version;last if$vers[$i+1]< $new_version;my$spec_string="$vers[$i+1]-from-$vers[$i]";$converted=_convert($converted,$down_convert{$spec_string},$vers[$i+1],$is_fragment);unless ($args->{is_fragment}){my$cmv=CPAN::Meta::Validator->new($converted);unless ($cmv->is_valid){my$errs=join("\n",$cmv->errors);die "Failed to downconvert metadata to $vers[$i+1]. Errors:\n$errs\n"}}}return$converted}else {my@vers=sort {$a <=> $b}keys%known_specs;for my$i (0 .. $#vers-1){next if$vers[$i]< $old_version;last if$vers[$i+1]> $new_version;my$spec_string="$vers[$i+1]-from-$vers[$i]";$converted=_convert($converted,$up_convert{$spec_string},$vers[$i+1],$is_fragment);unless ($args->{is_fragment}){my$cmv=CPAN::Meta::Validator->new($converted);unless ($cmv->is_valid){my$errs=join("\n",$cmv->errors);die "Failed to upconvert metadata to $vers[$i+1]. Errors:\n$errs\n"}}}return$converted}}sub upgrade_fragment {my ($self)=@_;my ($old_version)=$self->{spec};my%expected=map {;$_=>1}grep {defined}map {$fragments_generate{$old_version}{$_}}keys %{$self->{data}};my$converted=$self->convert(version=>$HIGHEST,is_fragment=>1);for my$key (keys %$converted){next if$key =~ /^x_/i || $key eq 'meta-spec';delete$converted->{$key}unless$expected{$key}}return$converted}1;
Subroutine BEGIN: called CC=1 SCAR=2.6
Subroutine BEGIN: called CC=3 SCAR=17.3
Subroutine __ANON__: not called CC=1 SCAR=2.6
Subroutine _author_list: called CC=5 SCAR=25.1
Subroutine _bad_version_hook: not called CC=2 SCAR=11.5
Subroutine _change_meta_spec: called CC=1 SCAR=2.6
Subroutine _clean_version: called CC=7 SCAR=30.6
Subroutine _cleanup_optional_features_2: called CC=5 SCAR=25.1
Subroutine _cleanup_prereqs: called CC=3 SCAR=17.3
Subroutine _cleanup_resources_2: called CC=3 SCAR=17.3
Subroutine _convert: called CC=15 SCAR=43.9
Subroutine _downgrade_license: not called CC=10 SCAR=36.7
Subroutine _downgrade_optional_features: not called CC=5 SCAR=25.1
Subroutine _downgrade_resources: not called CC=2 SCAR=11.5
Subroutine _extract_prereqs: not called CC=2 SCAR=11.5
Subroutine _extract_spec_version: called CC=13 SCAR=41.3
Subroutine _feature_2: not called CC=3 SCAR=17.3
Subroutine _get_build_requires: not called CC=3 SCAR=17.3
Subroutine _is_module_name: called CC=3 SCAR=17.3
Subroutine _is_urlish: called CC=2 SCAR=11.5
Subroutine _license_1: not called CC=3 SCAR=17.3
Subroutine _license_2: called CC=7 SCAR=30.6
Subroutine _no_index_1_2: not called CC=7 SCAR=30.6
Subroutine _no_index_directory: called CC=8 SCAR=32.8
Subroutine _no_prefix_ucfirst_custom: not called CC=1 SCAR=2.6
Subroutine _optional_features_1_4: not called CC=4 SCAR=21.6
Subroutine _optional_features_as_map: not called CC=4 SCAR=21.6
Subroutine _prereqs_from_1: not called CC=5 SCAR=25.1
Subroutine _prereqs_rel: called CC=3 SCAR=17.3
Subroutine _provides: called CC=6 SCAR=28.0
Subroutine _release_status: called CC=3 SCAR=17.3
Subroutine _release_status_from_version: not called CC=3 SCAR=17.3
Subroutine _repo_type: called CC=5 SCAR=25.1
Subroutine _resources_1_2: not called CC=6 SCAR=28.0
Subroutine _resources_1_3: not called CC=2 SCAR=11.5
Subroutine _ucfirst_custom: not called CC=2 SCAR=11.5
Subroutine _upgrade_optional_features: not called CC=3 SCAR=17.3
Subroutine _upgrade_resources_2: not called CC=2 SCAR=11.5
Subroutine _url_list: called CC=3 SCAR=17.3
Subroutine _url_or_drop: called CC=2 SCAR=11.5
Subroutine _version_map: called CC=14 SCAR=42.6
Subroutine convert: called CC=16 SCAR=45.1
Subroutine new: called CC=1 SCAR=2.6
Subroutine upgrade_fragment: not called CC=5 SCAR=25.1
Pod documented
Pod documented
Pod documented
Branch: 105 branches
BranchTrueFalseTotal
unless (defined $type) 6 2 8
unless $element 0 2 2
defined $_ && length $_ ? : 2 0 2
unless @$element 0 2 2
defined $vobj ? : 0 0 0
unless defined $element 0 270 270
unless length $element 0 270 270
if $element eq "undef" or $element eq "<undef>" 0 270 270
if (defined $v) { } 270 0 270
_is_qv($v) ? : 0 270 270
unless $element and ref $element eq "HASH" 2 0 2
unless keys %$new_data 0 0 0
unless $prereqs and ref $prereqs eq "HASH" 0 2 2
unless $resources and ref $resources eq "HASH" 0 2 2
if $key eq ":custom" or $key eq ":drop" 294 648 942
unless my $fcn = $spec->{$key} 0 648 648
if ($is_fragment and $key eq "generated_by") 0 648 648
unless ref $fcn and ref $fcn eq "CODE" 0 648 648
if defined $new_value 606 42 648
if $drop_list and grep {$key eq $_;} @$drop_list 0 610 610
if exists $spec->{$key} 606 4 610
if (not defined $element) { } 0 0 0
elsif (ref $element eq 'ARRAY') { } 0 0 0
elsif (not ref $element) { } 0 0 0
if (@$element > 1) { } 0 0 0
elsif (@$element == 1) { } 0 0 0
if (grep {not $is_open_source{$license_downgrade_map{lc $_} or 'unknown'};} @$element) { } 0 0 0
unless exists $meta->{"optional_features"} 0 0 0
unless defined $features->{$name}{$k} 0 0 0
unless exists $meta->{"resources"} 0 0 0
unless ref $prereqs eq "HASH" 0 0 0
unless defined $spec and ref $spec eq "HASH" 0 2 2
if (defined $v and $v =~ /^\d+(?:\.\d+)?$/) 2 0 2
if defined $v and grep {$v eq $_;} keys %known_specs 2 0 2
if defined $v and grep {$v == $_;} keys %known_specs 0 0 0
if exists $data->{"prereqs"} 0 0 0
if exists $data->{"configure_requires"} 0 0 0
unless $element and ref $element eq "HASH" 0 0 0
unless defined $mod and length $mod 0 520 520
defined $_[0] and $_[0] =~ /\A[-+.a-z0-9]+:.+/i 8 0 8
unless defined $element 0 0 0
if ($license_map_1{lc $element}) { } 0 0 0
unless defined $element 0 2 2
unless ref $element eq "ARRAY" 0 2 2
unless defined $lic 0 2 2
if (my $new = $license_map_2{lc $lic}) 2 0 2
@new_list ? : 2 0 2
unless $no_index 0 0 0
if (not ref $no_index) { } 0 0 0
elsif (ref $no_index eq 'ARRAY') { } 0 0 0
if (exists $no_index->{"files"}) 0 0 0
if (exists $no_index->{"modules"}) 0 0 0
unless $element 0 2 2
if (not ref $element) { } 0 2 2
elsif (ref $element eq 'ARRAY') { } 0 2 2
if (exists $element->{"dir"}) 0 2 2
if (exists $element->{"files"}) 0 2 2
if (exists $element->{"modules"}) 0 2 2
$version == 2 ? : 2 0 2
unless $element 0 0 0
unless $element 0 0 0
if (ref $element eq "ARRAY") 0 0 0
if $meta->{$key} 0 0 0
if $meta->{$rel} 0 0 0
unless $relation and ref $relation eq "HASH" 0 10 10
unless defined $element and ref $element eq "HASH" 0 2 2
$to_version == 2 ? : 2 0 2
if exists $element->{$k}{"version"} 270 0 270
if $element and $element =~ /\A(?:stable|testing|unstable)\z/ 2 0 2
$version =~ /_/ ? : 0 0 0
if defined $element 2 0 2
unless exists $meta->{"url"} 0 0 0
if $repo_url =~ /\A$type/ 0 0 0
if ($meta->{"license_url"} and not $resources->{"license"}) 0 0 0
if _is_urlish($meta->{"license_url"}) 0 0 0
unless keys %$resources 0 0 0
unless exists $meta->{"resources"} 0 0 0
unless $key =~ /[A-Z]/ 0 0 0
unless exists $meta->{"optional_features"} 0 0 0
unless exists $meta->{"resources"} 0 0 0
unless $element 2 0 2
unless @$element 0 0 0
if _is_urlish($element) 8 0 8
unless defined $element 26 14 40
if (ref $element eq 'HASH') { } 14 0 14
elsif (ref $element eq 'ARRAY') { } 0 0 0
elsif (ref $element eq '' and length $element) { } 0 0 0
if (() = each %$element) 260 14 274
unless _is_module_name($k) 0 260 260
if (not defined $v && length $v or $v eq "undef" or $v eq "<undef>") 0 260 260
if (_is_module_name($v) and not version::is_lax($v)) 0 260 260
if ($old_version == $new_version) { } 2 0 2
elsif ($old_version > $new_version) { } 0 0 0
unless ($args->{"is_fragment"}) 2 0 2
unless ($cmv->is_valid) 0 2 2
if $vers[$i] > $old_version 0 0 0
if $vers[$i + 1] < $new_version 0 0 0
unless ($args->{"is_fragment"}) 0 0 0
unless ($cmv->is_valid) 0 0 0
if $vers[$i] < $old_version 0 0 0
if $vers[$i + 1] > $new_version 0 0 0
unless ($args->{"is_fragment"}) 0 0 0
unless ($cmv->is_valid) 0 0 0
if $key =~ /^x_/i or $key eq "meta-spec" 0 0 0
unless $expected{$key} 0 0 0
Condition24%25/101
defined $_ and length $_
!ll&&!rl&&r
002
$element eq "undef" or $element eq "<undef>"
l!l&&r!l&&!r
00270
$element and ref $element eq "HASH"
!ll&&!rl&&r
200
$prereqs and ref $prereqs eq "HASH"
!ll&&!rl&&r
002
$resources and ref $resources eq "HASH"
!ll&&!rl&&r
002
$key eq ":custom" or $key eq ":drop"
l!l&&r!l&&!r
2922648
$is_fragment and $key eq "generated_by"
!ll&&!rl&&r
64800
ref $fcn and ref $fcn eq "CODE"
!ll&&!rl&&r
00648
$spec->{':custom'} || \&CPAN::Meta::Converter::_keep
l!l
2920
$drop_list and grep {$key eq $_;} @$drop_list
!ll&&!rl&&r
580300
$license_downgrade_map{lc $_} || 'unknown'
l!l
00
$license_downgrade_map{lc $element->[0]} || 'unknown'
l!l
00
$license_downgrade_map{lc $element} || 'unknown'
l!l
00
defined $spec and ref $spec eq "HASH"
!ll&&!rl&&r
002
$default || '1.0'
l!l
00
defined $v and $v =~ /^\d+(?:\.\d+)?$/
!ll&&!rl&&r
002
defined $v and grep {$v eq $_;} keys %known_specs
!ll&&!rl&&r
002
defined $v and grep {$v == $_;} keys %known_specs
!ll&&!rl&&r
000
$default || '1.2'
l!l
00
$element and ref $element eq "HASH"
!ll&&!rl&&r
000
_extract_prereqs($_[2]{'prereqs'}, ('test', 'requires')) || {}
l!l
00
_extract_prereqs($_[2]{'prereqs'}, ('build', 'requires')) || {}
l!l
00
defined $mod and length $mod
!ll&&!rl&&r
00520
$meta->{'no_index'} || $meta->{'private'}
l!l&&r!l&&!r
000
$relation and ref $relation eq "HASH"
!ll&&!rl&&r
0010
defined $element and ref $element eq "HASH"
!ll&&!rl&&r
002
$element and $element =~ /\A(?:stable|testing|unstable)\z/
!ll&&!rl&&r
002
$meta->{'version'} || ''
l!l
00
$meta->{'resources'} || {}
l!l
00
$meta->{"license_url"} and not $resources->{"license"}
!ll&&!rl&&r
000
not defined $v && length $v or $v eq "undef" or $v eq "<undef>"
l!l&&r!l&&!r
00260
not defined $v && length $v or $v eq "undef"
l!l&&r!l&&!r
00260
defined $v && length $v
!ll&&!rl&&r
00260
_is_module_name($v) and not version::is_lax($v)
!ll&&!rl&&r
26000
ref $element eq "" and length $element
!ll&&!rl&&r
000
$args->{'version'} || $HIGHEST
l!l&&r!l&&!r
200
$key =~ /^x_/i or $key eq "meta-spec"
l!l&&r!l&&!r
000
MC/DC0%0/2
defined $_ and length $_
defined $_ length $_
MC/DC0%0/2
$element eq "undef" or $element eq "<undef>"
$element eq "undef" $element eq "<undef>"
MC/DC0%0/2
$element and ref $element eq "HASH"
$element ref $element eq "HASH"
MC/DC0%0/2
$prereqs and ref $prereqs eq "HASH"
$prereqs ref $prereqs eq "HASH"
MC/DC0%0/2
$resources and ref $resources eq "HASH"
$resources ref $resources eq "HASH"
MC/DC100%2/2
$key eq ":custom" or $key eq ":drop"
$key eq ":custom" $key eq ":drop"
MC/DC0%0/2
$is_fragment and $key eq "generated_by"
$is_fragment $key eq "generated_by"
MC/DC0%0/2
ref $fcn and ref $fcn eq "CODE"
ref $fcn ref $fcn eq "CODE"
MC/DC0%0/1
$spec->{':custom'} || \&CPAN::Meta::Converter::_keep
$spec->{':custom'}
MC/DC0%0/2
$drop_list and grep {$key eq $_;} @$drop_list
$drop_list grep {$key eq $_;} @$drop_list
MC/DC0%0/1
$license_downgrade_map{lc $_} || 'unknown'
$license_downgrade_map{lc $_}
MC/DC0%0/1
$license_downgrade_map{lc $element->[0]} || 'unknown'
$license_downgrade_map{lc $element->[0]}
MC/DC0%0/1
$license_downgrade_map{lc $element} || 'unknown'
$license_downgrade_map{lc $element}
MC/DC0%0/2
defined $spec and ref $spec eq "HASH"
defined $spec ref $spec eq "HASH"
MC/DC0%0/1
$default || '1.0'
$default
MC/DC0%0/2
defined $v and $v =~ /^\d+(?:\.\d+)?$/
defined $v $v =~ /^\d+(?:\.\d+)?$/
MC/DC0%0/2
defined $v and grep {$v eq $_;} keys %known_specs
defined $v grep {$v eq $_;} keys %known_specs
MC/DC0%0/2
defined $v and grep {$v == $_;} keys %known_specs
defined $v grep {$v == $_;} keys %known_specs
MC/DC0%0/1
$default || '1.2'
$default
MC/DC0%0/2
$element and ref $element eq "HASH"
$element ref $element eq "HASH"
MC/DC0%0/1
_extract_prereqs($_[2]{'prereqs'}, ('test', 'requires')) || {}
_extract_prereqs($_[2]{'prereqs'}, ('test', 'requires'))
MC/DC0%0/1
_extract_prereqs($_[2]{'prereqs'}, ('build', 'requires')) || {}
_extract_prereqs($_[2]{'prereqs'}, ('build', 'requires'))
MC/DC0%0/2
defined $mod and length $mod
defined $mod length $mod
MC/DC0%0/2
$meta->{'no_index'} || $meta->{'private'}
$meta->{'no_index'} $meta->{'private'}
MC/DC0%0/2
$relation and ref $relation eq "HASH"
$relation ref $relation eq "HASH"
MC/DC0%0/2
defined $element and ref $element eq "HASH"
defined $element ref $element eq "HASH"
MC/DC0%0/2
$element and $element =~ /\A(?:stable|testing|unstable)\z/
$element $element =~ /\A(?:stable|testing|unstable)\z/
MC/DC0%0/1
$meta->{'version'} || ''
$meta->{'version'}
MC/DC0%0/1
$meta->{'resources'} || {}
$meta->{'resources'}
MC/DC0%0/2
$meta->{"license_url"} and not $resources->{"license"}
$meta->{"license_url"} not $resources->{"license"}
MC/DC0%0/4
not defined $v && length $v or $v eq "undef" or $v eq "<undef>"
defined $v length $v $v eq "undef" $v eq "<undef>"
MC/DC0%0/2
_is_module_name($v) and not version::is_lax($v)
_is_module_name($v) not version::is_lax($v)
MC/DC0%0/2
ref $element eq "" and length $element
ref $element eq "" length $element
MC/DC0%0/2
$args->{'version'} || $HIGHEST
$args->{'version'} $HIGHEST
MC/DC0%0/2
$key =~ /^x_/i or $key eq "meta-spec"
$key =~ /^x_/i $key eq "meta-spec"
Truth table33%1/3
A and B
A= defined $_B= length $_
ABresult
0X0
100
111
Truth table33%1/3
A or B
A= $element eq "undef"B= $element eq "<undef>"
ABresult
1X1
011
000
Truth table33%1/3
A and B
A= $elementB= ref $element eq "HASH"
ABresult
0X0
100
111
Truth table33%1/3
A and B
A= $prereqsB= ref $prereqs eq "HASH"
ABresult
0X0
100
111
Truth table33%1/3
A and B
A= $resourcesB= ref $resources eq "HASH"
ABresult
0X0
100
111
Truth table100%3/3
A or B
A= $key eq ":custom"B= $key eq ":drop"
ABresult
1X1
011
000
Truth table33%1/3
A and B
A= $is_fragmentB= $key eq "generated_by"
ABresult
0X0
100
111
Truth table33%1/3
A and B
A= ref $fcnB= ref $fcn eq "CODE"
ABresult
0X0
100
111
Truth table50%1/2
A
A= $spec->{':custom'}
Aresult
11
00
Truth table66%2/3
A and B
A= $drop_listB= grep {$key eq $_;} @$drop_list
ABresult
0X0
100
111
Truth table0%0/2
A
A= $license_downgrade_map{lc $_}
Aresult
11
00
Truth table0%0/2
A
A= $license_downgrade_map{lc $element->[0]}
Aresult
11
00
Truth table0%0/2
A
A= $license_downgrade_map{lc $element}
Aresult
11
00
Truth table33%1/3
A and B
A= defined $specB= ref $spec eq "HASH"
ABresult
0X0
100
111
Truth table0%0/2
A
A= $default
Aresult
11
00
Truth table33%1/3
A and B
A= defined $vB= $v =~ /^\d+(?:\.\d+)?$/
ABresult
0X0
100
111
Truth table33%1/3
A and B
A= defined $vB= grep {$v eq $_;} keys %known_specs
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $vB= grep {$v == $_;} keys %known_specs
ABresult
0X0
100
111
Truth table0%0/2
A
A= $default
Aresult
11
00
Truth table0%0/3
A and B
A= $elementB= ref $element eq "HASH"
ABresult
0X0
100
111
Truth table0%0/2
A
A= _extract_prereqs($_[2]{'prereqs'}, ('test', 'requires'))
Aresult
11
00
Truth table0%0/2
A
A= _extract_prereqs($_[2]{'prereqs'}, ('build', 'requires'))
Aresult
11
00
Truth table33%1/3
A and B
A= defined $modB= length $mod
ABresult
0X0
100
111
Truth table0%0/3
A || B
A= $meta->{'no_index'}B= $meta->{'private'}
ABresult
1X1
011
000
Truth table33%1/3
A and B
A= $relationB= ref $relation eq "HASH"
ABresult
0X0
100
111
Truth table33%1/3
A and B
A= defined $elementB= ref $element eq "HASH"
ABresult
0X0
100
111
Truth table33%1/3
A and B
A= $elementB= $element =~ /\A(?:stable|testing|unstable)\z/
ABresult
0X0
100
111
Truth table0%0/2
A
A= $meta->{'version'}
Aresult
11
00
Truth table0%0/2
A
A= $meta->{'resources'}
Aresult
11
00
Truth table0%0/3
A and not(B)
A= $meta->{"license_url"}B= not $resources->{"license"}
ABresult
0X0
100
111
Truth table20%1/5
not(A && B) or C or D
A= defined $vB= length $vC= $v eq "undef"D= $v eq "<undef>"
ABCDresult
0XXX1
10XX1
111X1
11011
11000
Truth table33%1/3
A and not(B)
A= _is_module_name($v)B= not version::is_lax($v)
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= ref $element eq ""B= length $element
ABresult
0X0
100
111
Truth table33%1/3
A || B
A= $args->{'version'}B= $HIGHEST
ABresult
1X1
011
000
Truth table0%0/3
A or B
A= $key =~ /^x_/iB= $key eq "meta-spec"
ABresult
1X1
011
000
159 CPAN_META_CONVERTER
160  
161 2 $fatpacked{"CPAN/Meta/Feature.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'CPAN_META_FEATURE';
162 0 ▶ use 5.006;use strict;use warnings;package CPAN::Meta::Feature;our$VERSION='2.150005';use CPAN::Meta::Prereqs;sub new {my ($class,$identifier,$spec)=@_;my%guts=(identifier=>$identifier,description=>$spec->{description},prereqs=>CPAN::Meta::Prereqs->new($spec->{prereqs}),);bless \%guts=>$class}sub identifier {$_[0]{identifier}}sub description {$_[0]{description}}sub prereqs {$_[0]{prereqs}}1;
Subroutine BEGIN: called CC=1 SCAR=0.4
Subroutine BEGIN: called CC=1 SCAR=0.4
Subroutine BEGIN: called CC=1 SCAR=0.4
Subroutine BEGIN: called CC=1 SCAR=0.4
Subroutine description: not called CC=1 SCAR=0.4
Subroutine identifier: not called CC=1 SCAR=0.4
Subroutine new: not called CC=1 SCAR=0.4
Subroutine prereqs: not called CC=1 SCAR=0.4
Pod documented
Pod documented
Pod documented
Pod documented
163 CPAN_META_FEATURE
164  
165 2 $fatpacked{"CPAN/Meta/History.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'CPAN_META_HISTORY';
166 use 5.006;use strict;use warnings;package CPAN::Meta::History;our$VERSION='2.150005';1;
167 CPAN_META_HISTORY
168  
169 2 $fatpacked{"CPAN/Meta/Merge.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'CPAN_META_MERGE';
170 use strict;use warnings;package CPAN::Meta::Merge;our$VERSION='2.150005';use Carp qw/croak/;use Scalar::Util qw/blessed/;use CPAN::Meta::Converter 2.141170;sub _is_identical {my ($left,$right)=@_;return (not defined$left and not defined$right)|| (defined$left and defined$right and $left eq $right)}sub _identical {my ($left,$right,$path)=@_;croak sprintf "Can't merge attribute %s: '%s' does not equal '%s'",join('.',@{$path}),$left,$right unless _is_identical($left,$right);return$left}sub _merge {my ($current,$next,$mergers,$path)=@_;for my$key (keys %{$next}){if (not exists$current->{$key}){$current->{$key}=$next->{$key}}elsif (my$merger=$mergers->{$key}){$current->{$key}=$merger->($current->{$key},$next->{$key},[@{$path},$key ])}elsif ($merger=$mergers->{':default'}){$current->{$key}=$merger->($current->{$key},$next->{$key},[@{$path},$key ])}else {croak sprintf "Can't merge unknown attribute '%s'",join '.',@{$path},$key}}return$current}sub _uniq {my%seen=();return grep {not $seen{$_}++}@_}sub _set_addition {my ($left,$right)=@_;return [+_uniq(@{$left},@{$right})]}sub _uniq_map {my ($left,$right,$path)=@_;for my$key (keys %{$right}){if (not exists$left->{$key}){$left->{$key}=$right->{$key}}elsif (_is_identical($left->{$key},$right->{$key})){1}elsif (ref$left->{$key}eq 'HASH' and ref$right->{$key}eq 'HASH'){$left->{$key}=_uniq_map($left->{$key},$right->{$key},[@{$path},$key ])}else {croak 'Duplication of element ' .join '.',@{$path},$key}}return$left}sub _improvize {my ($left,$right,$path)=@_;my ($name)=reverse @{$path};if ($name =~ /^x_/){if (ref($left)eq 'ARRAY'){return _set_addition($left,$right,$path)}elsif (ref($left)eq 'HASH'){return _uniq_map($left,$right,$path)}else {return _identical($left,$right,$path)}}croak sprintf "Can't merge '%s'",join '.',@{$path}}sub _optional_features {my ($left,$right,$path)=@_;for my$key (keys %{$right}){if (not exists$left->{$key}){$left->{$key}=$right->{$key}}else {for my$subkey (keys %{$right->{$key}}){next if$subkey eq 'prereqs';if (not exists$left->{$key}{$subkey}){$left->{$key}{$subkey}=$right->{$key}{$subkey}}else {Carp::croak "Cannot merge two optional_features named '$key' with different '$subkey' values" if do {no warnings 'uninitialized';$left->{$key}{$subkey}ne $right->{$key}{$subkey}}}}require CPAN::Meta::Prereqs;$left->{$key}{prereqs}=CPAN::Meta::Prereqs->new($left->{$key}{prereqs})->with_merged_prereqs(CPAN::Meta::Prereqs->new($right->{$key}{prereqs}))->as_string_hash}}return$left}my%default=(abstract=>\&_identical,author=>\&_set_addition,dynamic_config=>sub {my ($left,$right)=@_;return$left || $right},generated_by=>sub {my ($left,$right)=@_;return join ', ',_uniq(split(/, /,$left),split(/, /,$right))},license=>\&_set_addition,'meta-spec'=>{version=>\&_identical,url=>\&_identical },name=>\&_identical,release_status=>\&_identical,version=>\&_identical,description=>\&_identical,keywords=>\&_set_addition,no_index=>{map {($_=>\&_set_addition)}qw/file directory package namespace/ },optional_features=>\&_optional_features,prereqs=>sub {require CPAN::Meta::Prereqs;my ($left,$right)=map {CPAN::Meta::Prereqs->new($_)}@_[0,1];return$left->with_merged_prereqs($right)->as_string_hash},provides=>\&_uniq_map,resources=>{license=>\&_set_addition,homepage=>\&_identical,bugtracker=>\&_uniq_map,repository=>\&_uniq_map,':default'=>\&_improvize,},':default'=>\&_improvize,);sub new {my ($class,%arguments)=@_;croak 'default version required' if not exists$arguments{default_version};my%mapping=%default;my%extra=%{$arguments{extra_mappings}|| {}};for my$key (keys%extra){if (ref($mapping{$key})eq 'HASH'){$mapping{$key}={%{$mapping{$key}},%{$extra{$key}}}}else {$mapping{$key}=$extra{$key}}}return bless {default_version=>$arguments{default_version},mapping=>_coerce_mapping(\%mapping,[]),},$class}my%coderef_for=(set_addition=>\&_set_addition,uniq_map=>\&_uniq_map,identical=>\&_identical,improvize=>\&_improvize,);sub _coerce_mapping {my ($orig,$map_path)=@_;my%ret;for my$key (keys %{$orig}){my$value=$orig->{$key};if (ref($orig->{$key})eq 'CODE'){$ret{$key}=$value}elsif (ref($value)eq 'HASH'){my$mapping=_coerce_mapping($value,[@{$map_path},$key ]);$ret{$key}=sub {my ($left,$right,$path)=@_;return _merge($left,$right,$mapping,[@{$path}])}}elsif ($coderef_for{$value}){$ret{$key}=$coderef_for{$value}}else {croak "Don't know what to do with " .join '.',@{$map_path},$key}}return \%ret}sub merge {my ($self,@items)=@_;my$current={};for my$next (@items){if (blessed($next)&& $next->isa('CPAN::Meta')){$next=$next->as_struct}elsif (ref($next)eq 'HASH'){my$cmc=CPAN::Meta::Converter->new($next,default_version=>$self->{default_version});$next=$cmc->upgrade_fragment}else {croak "Don't know how to merge '$next'"}$current=_merge($current,$next,$self->{mapping},[])}return$current}1;
171 CPAN_META_MERGE
172  
173 2 $fatpacked{"CPAN/Meta/Prereqs.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'CPAN_META_PREREQS';
174 0 ▶ use 5.006;use strict;use warnings;package CPAN::Meta::Prereqs;our$VERSION='2.150005';use Carp qw(confess);use Scalar::Util qw(blessed);use CPAN::Meta::Requirements 2.121;sub __legal_phases {qw(configure build test runtime develop)}sub __legal_types {qw(requires recommends suggests conflicts)}sub new {my ($class,$prereq_spec)=@_;$prereq_spec ||= {};my%is_legal_phase=map {;$_=>1}$class->__legal_phases;my%is_legal_type=map {;$_=>1}$class->__legal_types;my%guts;PHASE: for my$phase (keys %$prereq_spec){next PHASE unless$phase =~ /\Ax_/i or $is_legal_phase{$phase};my$phase_spec=$prereq_spec->{$phase };next PHASE unless keys %$phase_spec;TYPE: for my$type (keys %$phase_spec){next TYPE unless$type =~ /\Ax_/i or $is_legal_type{$type};my$spec=$phase_spec->{$type };next TYPE unless keys %$spec;$guts{prereqs}{$phase}{$type}=CPAN::Meta::Requirements->from_string_hash($spec)}}return bless \%guts=>$class}sub requirements_for {my ($self,$phase,$type)=@_;confess "requirements_for called without phase" unless defined$phase;confess "requirements_for called without type" unless defined$type;unless ($phase =~ /\Ax_/i or grep {$phase eq $_}$self->__legal_phases){confess "requested requirements for unknown phase: $phase"}unless ($type =~ /\Ax_/i or grep {$type eq $_}$self->__legal_types){confess "requested requirements for unknown type: $type"}my$req=($self->{prereqs}{$phase}{$type}||= CPAN::Meta::Requirements->new);$req->finalize if$self->is_finalized;return$req}sub with_merged_prereqs {my ($self,$other)=@_;my@other=blessed($other)? $other : @$other;my@prereq_objs=($self,@other);my%new_arg;for my$phase ($self->__legal_phases){for my$type ($self->__legal_types){my$req=CPAN::Meta::Requirements->new;for my$prereq (@prereq_objs){my$this_req=$prereq->requirements_for($phase,$type);next unless$this_req->required_modules;$req->add_requirements($this_req)}next unless$req->required_modules;$new_arg{$phase }{$type }=$req->as_string_hash}}return (ref$self)->new(\%new_arg)}sub merged_requirements {my ($self,$phases,$types)=@_;$phases=[qw/runtime build test/]unless defined$phases;$types=[qw/requires recommends/]unless defined$types;confess "merged_requirements phases argument must be an arrayref" unless ref$phases eq 'ARRAY';confess "merged_requirements types argument must be an arrayref" unless ref$types eq 'ARRAY';my$req=CPAN::Meta::Requirements->new;for my$phase (@$phases){unless ($phase =~ /\Ax_/i or grep {$phase eq $_}$self->__legal_phases){confess "requested requirements for unknown phase: $phase"}for my$type (@$types){unless ($type =~ /\Ax_/i or grep {$type eq $_}$self->__legal_types){confess "requested requirements for unknown type: $type"}$req->add_requirements($self->requirements_for($phase,$type))}}$req->finalize if$self->is_finalized;return$req}sub as_string_hash {my ($self)=@_;my%hash;for my$phase ($self->__legal_phases){for my$type ($self->__legal_types){my$req=$self->requirements_for($phase,$type);next unless$req->required_modules;$hash{$phase }{$type }=$req->as_string_hash}}return \%hash}sub is_finalized {$_[0]{finalized}}sub finalize {my ($self)=@_;$self->{finalized}=1;for my$phase (keys %{$self->{prereqs}}){$_->finalize for values %{$self->{prereqs}{$phase}}}}sub clone {my ($self)=@_;my$clone=(ref$self)->new($self->as_string_hash)}1;
Subroutine BEGIN: called CC=1 SCAR=5.4
Subroutine BEGIN: called CC=1 SCAR=5.4
Subroutine BEGIN: called CC=1 SCAR=5.4
Subroutine BEGIN: called CC=1 SCAR=5.4
Subroutine BEGIN: called CC=1 SCAR=5.4
Subroutine BEGIN: called CC=1 SCAR=5.4
Subroutine __legal_phases: not called CC=1 SCAR=5.4
Subroutine __legal_types: not called CC=1 SCAR=5.4
Subroutine as_string_hash: not called CC=4 SCAR=27.3
Subroutine clone: not called CC=1 SCAR=5.4
Subroutine finalize: not called CC=3 SCAR=22.4
Subroutine is_finalized: not called CC=1 SCAR=5.4
Subroutine merged_requirements: not called CC=12 SCAR=47.4
Subroutine new: not called CC=10 SCAR=44.0
Subroutine requirements_for: not called CC=9 SCAR=42.0
Subroutine with_merged_prereqs: not called CC=7 SCAR=37.4
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Branch: 20 branches
BranchTrueFalseTotal
unless $req->required_modules 0 0 0
unless defined $phases 0 0 0
unless defined $types 0 0 0
unless ref $phases eq "ARRAY" 0 0 0
unless ref $types eq "ARRAY" 0 0 0
unless ($phase =~ /\Ax_/i or grep {$phase eq $_;} $self->__legal_phases) 0 0 0
unless ($type =~ /\Ax_/i or grep {$type eq $_;} $self->__legal_types) 0 0 0
if $self->is_finalized 0 0 0
unless $phase =~ /\Ax_/i or $is_legal_phase{$phase} 0 0 0
unless keys %$phase_spec 0 0 0
unless $type =~ /\Ax_/i or $is_legal_type{$type} 0 0 0
unless keys %$spec 0 0 0
unless defined $phase 0 0 0
unless defined $type 0 0 0
unless ($phase =~ /\Ax_/i or grep {$phase eq $_;} $self->__legal_phases) 0 0 0
unless ($type =~ /\Ax_/i or grep {$type eq $_;} $self->__legal_types) 0 0 0
if $self->is_finalized 0 0 0
builtin::blessed($other) ? : 0 0 0
unless $this_req->required_modules 0 0 0
unless $req->required_modules 0 0 0
Condition0%0/23
$phase =~ /\Ax_/i or grep {$phase eq $_;} $self->__legal_phases
l!l&&r!l&&!r
000
$type =~ /\Ax_/i or grep {$type eq $_;} $self->__legal_types
l!l&&r!l&&!r
000
$prereq_spec ||= {}
l!l
00
$phase =~ /\Ax_/i or $is_legal_phase{$phase}
l!l&&r!l&&!r
000
$type =~ /\Ax_/i or $is_legal_type{$type}
l!l&&r!l&&!r
000
$phase =~ /\Ax_/i or grep {$phase eq $_;} $self->__legal_phases
l!l&&r!l&&!r
000
$type =~ /\Ax_/i or grep {$type eq $_;} $self->__legal_types
l!l&&r!l&&!r
000
$self->{"prereqs"}{$phase}{$type} ||= "CPAN::Meta::Requirements"->new
l!l&&r!l&&!r
000
MC/DC0%0/2
$phase =~ /\Ax_/i or grep {$phase eq $_;} $self->__legal_phases
$phase =~ /\Ax_/i grep {$phase eq $_;} $self->__legal_phases
MC/DC0%0/2
$type =~ /\Ax_/i or grep {$type eq $_;} $self->__legal_types
$type =~ /\Ax_/i grep {$type eq $_;} $self->__legal_types
MC/DC0%0/1
$prereq_spec ||= {}
$prereq_spec
MC/DC0%0/2
$phase =~ /\Ax_/i or $is_legal_phase{$phase}
$phase =~ /\Ax_/i $is_legal_phase{$phase}
MC/DC0%0/2
$type =~ /\Ax_/i or $is_legal_type{$type}
$type =~ /\Ax_/i $is_legal_type{$type}
MC/DC0%0/2
$phase =~ /\Ax_/i or grep {$phase eq $_;} $self->__legal_phases
$phase =~ /\Ax_/i grep {$phase eq $_;} $self->__legal_phases
MC/DC0%0/2
$type =~ /\Ax_/i or grep {$type eq $_;} $self->__legal_types
$type =~ /\Ax_/i grep {$type eq $_;} $self->__legal_types
MC/DC0%0/2
$self->{"prereqs"}{$phase}{$type} ||= "CPAN::Meta::Requirements"->new
$self->{"prereqs"}{$phase}{$type} "CPAN::Meta::Requirements"->new
Truth table0%0/3
A or B
A= $phase =~ /\Ax_/iB= grep {$phase eq $_;} $self->__legal_phases
ABresult
1X1
011
000
Truth table0%0/3
A or B
A= $type =~ /\Ax_/iB= grep {$type eq $_;} $self->__legal_types
ABresult
1X1
011
000
Truth table0%0/2
A
A= $prereq_spec
Aresult
11
00
Truth table0%0/3
A or B
A= $phase =~ /\Ax_/iB= $is_legal_phase{$phase}
ABresult
1X1
011
000
Truth table0%0/3
A or B
A= $type =~ /\Ax_/iB= $is_legal_type{$type}
ABresult
1X1
011
000
Truth table0%0/3
A or B
A= $phase =~ /\Ax_/iB= grep {$phase eq $_;} $self->__legal_phases
ABresult
1X1
011
000
Truth table0%0/3
A or B
A= $type =~ /\Ax_/iB= grep {$type eq $_;} $self->__legal_types
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $self->{"prereqs"}{$phase}{$type}B= "CPAN::Meta::Requirements"->new
ABresult
1X1
011
000
175 CPAN_META_PREREQS
176  
177 2 $fatpacked{"CPAN/Meta/Requirements.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'CPAN_META_REQUIREMENTS';
178 0 ▶ use strict;use warnings;package CPAN::Meta::Requirements;our$VERSION='2.133';use Carp ();BEGIN {eval "use version ()";if (my$err=$@){eval "use ExtUtils::MakeMaker::version" or die$err}}*_is_qv=version->can('is_qv')? sub {$_[0]->is_qv}: sub {exists $_[0]->{qv}};my$V0=version->new(0);my@valid_options=qw(bad_version_hook);sub new {my ($class,$options)=@_;$options ||= {};Carp::croak "Argument to $class\->new() must be a hash reference" unless ref$options eq 'HASH';my%self=map {;$_=>$options->{$_}}@valid_options;return bless \%self=>$class}sub _find_magic_vstring {my$value=shift;my$tvalue='';require B;my$sv=B::svref_2object(\$value);my$magic=ref($sv)eq 'B::PVMG' ? $sv->MAGIC : undef;while ($magic){if ($magic->TYPE eq 'V'){$tvalue=$magic->PTR;$tvalue =~ s/^v?(.+)$/v$1/;last}else {$magic=$magic->MOREMAGIC}}return$tvalue}sub _isa_version {UNIVERSAL::isa($_[0],'UNIVERSAL')&& $_[0]->isa('version')}sub _version_object {my ($self,$module,$version)=@_;my ($vobj,$err);if (not defined$version or (!ref($version)&& $version eq '0')){return$V0}elsif (ref($version)eq 'version' || _isa_version($version)){$vobj=$version}else {if ($INC{'version/vpp.pm'}|| $INC{'ExtUtils/MakeMaker/version/vpp.pm'}){my$magic=_find_magic_vstring($version);$version=$magic if length$magic}eval {local$SIG{__WARN__}=sub {die "Invalid version: $_[0]"};$vobj=version->new($version)};if (my$err=$@){my$hook=$self->{bad_version_hook};$vobj=eval {$hook->($version,$module)}if ref$hook eq 'CODE';unless (eval {$vobj->isa("version")}){$err =~ s{ at .* line \d+.*$}{};die "Can't convert '$version': $err"}}}if ($vobj =~ m{\A\.}){$vobj=version->new("0$vobj")}if (_is_qv($vobj)){$vobj=version->new($vobj->normal)}return$vobj}BEGIN {for my$type (qw(maximum exclusion exact_version)){my$method="with_$type";my$to_add=$type eq 'exact_version' ? $type : "add_$type";my$code=sub {my ($self,$name,$version)=@_;$version=$self->_version_object($name,$version);$self->__modify_entry_for($name,$method,$version);return$self};no strict 'refs';*$to_add=$code}}sub add_minimum {my ($self,$name,$version)=@_;if (not defined$version or "$version" eq '0'){return$self if$self->__entry_for($name);Carp::confess("can't add new requirements to finalized requirements")if$self->is_finalized;$self->{requirements}{$name }=CPAN::Meta::Requirements::_Range::Range->with_minimum($V0)}else {$version=$self->_version_object($name,$version);$self->__modify_entry_for($name,'with_minimum',$version)}return$self}sub add_requirements {my ($self,$req)=@_;for my$module ($req->required_modules){my$modifiers=$req->__entry_for($module)->as_modifiers;for my$modifier (@$modifiers){my ($method,@args)=@$modifier;$self->$method($module=>@args)}}return$self}sub accepts_module {my ($self,$module,$version)=@_;$version=$self->_version_object($module,$version);return 1 unless my$range=$self->__entry_for($module);return$range->_accepts($version)}sub clear_requirement {my ($self,$module)=@_;return$self unless$self->__entry_for($module);Carp::confess("can't clear requirements on finalized requirements")if$self->is_finalized;delete$self->{requirements}{$module };return$self}sub requirements_for_module {my ($self,$module)=@_;my$entry=$self->__entry_for($module);return unless$entry;return$entry->as_string}sub required_modules {keys %{$_[0]{requirements}}}sub clone {my ($self)=@_;my$new=(ref$self)->new;return$new->add_requirements($self)}sub __entry_for {$_[0]{requirements}{$_[1]}}sub __modify_entry_for {my ($self,$name,$method,$version)=@_;my$fin=$self->is_finalized;my$old=$self->__entry_for($name);Carp::confess("can't add new requirements to finalized requirements")if$fin and not $old;my$new=($old || 'CPAN::Meta::Requirements::_Range::Range')->$method($version);Carp::confess("can't modify finalized requirements")if$fin and $old->as_string ne $new->as_string;$self->{requirements}{$name }=$new}sub is_simple {my ($self)=@_;for my$module ($self->required_modules){return if$self->__entry_for($module)->as_string =~ /\s/}return 1}sub is_finalized {$_[0]{finalized}}sub finalize {$_[0]{finalized}=1}sub as_string_hash {my ($self)=@_;my%hash=map {;$_=>$self->{requirements}{$_}->as_string}$self->required_modules;return \%hash}my%methods_for_op=('=='=>[qw(exact_version) ],'!='=>[qw(add_exclusion) ],'>='=>[qw(add_minimum) ],'<='=>[qw(add_maximum) ],'>'=>[qw(add_minimum add_exclusion) ],'<'=>[qw(add_maximum add_exclusion) ],);sub add_string_requirement {my ($self,$module,$req)=@_;unless (defined$req && length$req){$req=0;$self->_blank_carp($module)}my$magic=_find_magic_vstring($req);if (length$magic){$self->add_minimum($module=>$magic);return}my@parts=split qr{\s*,\s*},$req;for my$part (@parts){my ($op,$ver)=$part =~ m{\A\s*(==|>=|>|<=|<|!=)\s*(.*)\z};if (!defined$op){$self->add_minimum($module=>$part)}else {Carp::confess("illegal requirement string: $req")unless my$methods=$methods_for_op{$op };$self->$_($module=>$ver)for @$methods}}}sub _blank_carp {my ($self,$module)=@_;Carp::carp("Undefined requirement for $module treated as '0'")}sub from_string_hash {my ($class,$hash,$options)=@_;my$self=$class->new($options);for my$module (keys %$hash){my$req=$hash->{$module};unless (defined$req && length$req){$req=0;$class->_blank_carp($module)}$self->add_string_requirement($module,$req)}return$self}{package CPAN::Meta::Requirements::_Range::Exact;sub _new {bless {version=>$_[1]}=>$_[0]}sub _accepts {return $_[0]{version}==$_[1]}sub as_string {return "== $_[0]{version}"}sub as_modifiers {return [[exact_version=>$_[0]{version}]]}sub _clone {(ref $_[0])->_new(version->new($_[0]{version}))}sub with_exact_version {my ($self,$version)=@_;return$self->_clone if$self->_accepts($version);Carp::confess("illegal requirements: unequal exact version specified")}sub with_minimum {my ($self,$minimum)=@_;return$self->_clone if$self->{version}>= $minimum;Carp::confess("illegal requirements: minimum above exact specification")}sub with_maximum {my ($self,$maximum)=@_;return$self->_clone if$self->{version}<= $maximum;Carp::confess("illegal requirements: maximum below exact specification")}sub with_exclusion {my ($self,$exclusion)=@_;return$self->_clone unless$exclusion==$self->{version};Carp::confess("illegal requirements: excluded exact specification")}}{package CPAN::Meta::Requirements::_Range::Range;sub _self {ref($_[0])? $_[0]: (bless {}=>$_[0])}sub _clone {return (bless {}=>$_[0])unless ref $_[0];my ($s)=@_;my%guts=((exists$s->{minimum}? (minimum=>version->new($s->{minimum})): ()),(exists$s->{maximum}? (maximum=>version->new($s->{maximum})): ()),(exists$s->{exclusions}? (exclusions=>[map {version->new($_)}@{$s->{exclusions}}]): ()),);bless \%guts=>ref($s)}sub as_modifiers {my ($self)=@_;my@mods;push@mods,[add_minimum=>$self->{minimum}]if exists$self->{minimum};push@mods,[add_maximum=>$self->{maximum}]if exists$self->{maximum};push@mods,map {;[add_exclusion=>$_ ]}@{$self->{exclusions}|| []};return \@mods}sub as_string {my ($self)=@_;return 0 if!keys %$self;return "$self->{minimum}" if (keys %$self)==1 and exists$self->{minimum};my@exclusions=@{$self->{exclusions}|| []};my@parts;for my$pair ([qw(>= > minimum) ],[qw(<= < maximum) ],){my ($op,$e_op,$k)=@$pair;if (exists$self->{$k}){my@new_exclusions=grep {$_!=$self->{$k }}@exclusions;if (@new_exclusions==@exclusions){push@parts,"$op $self->{ $k }"}else {push@parts,"$e_op $self->{ $k }";@exclusions=@new_exclusions}}}push@parts,map {;"!= $_"}@exclusions;return join q{, },@parts}sub with_exact_version {my ($self,$version)=@_;$self=$self->_clone;Carp::confess("illegal requirements: exact specification outside of range")unless$self->_accepts($version);return CPAN::Meta::Requirements::_Range::Exact->_new($version)}sub _simplify {my ($self)=@_;if (defined$self->{minimum}and defined$self->{maximum}){if ($self->{minimum}==$self->{maximum}){Carp::confess("illegal requirements: excluded all values")if grep {$_==$self->{minimum}}@{$self->{exclusions}|| []};return CPAN::Meta::Requirements::_Range::Exact->_new($self->{minimum})}Carp::confess("illegal requirements: minimum exceeds maximum")if$self->{minimum}> $self->{maximum}}if ($self->{exclusions}){my%seen;@{$self->{exclusions}}=grep {(!defined$self->{minimum}or $_ >= $self->{minimum})and (!defined$self->{maximum}or $_ <= $self->{maximum})and!$seen{$_}++}@{$self->{exclusions}}}return$self}sub with_minimum {my ($self,$minimum)=@_;$self=$self->_clone;if (defined (my$old_min=$self->{minimum})){$self->{minimum}=(sort {$b cmp $a}($minimum,$old_min))[0]}else {$self->{minimum}=$minimum}return$self->_simplify}sub with_maximum {my ($self,$maximum)=@_;$self=$self->_clone;if (defined (my$old_max=$self->{maximum})){$self->{maximum}=(sort {$a cmp $b}($maximum,$old_max))[0]}else {$self->{maximum}=$maximum}return$self->_simplify}sub with_exclusion {my ($self,$exclusion)=@_;$self=$self->_clone;push @{$self->{exclusions}||= []},$exclusion;return$self->_simplify}sub _accepts {my ($self,$version)=@_;return if defined$self->{minimum}and $version < $self->{minimum};return if defined$self->{maximum}and $version > $self->{maximum};return if defined$self->{exclusions}and grep {$version==$_}@{$self->{exclusions}};return 1}}1;
Subroutine BEGIN: called CC=1 SCAR=2.8
Subroutine BEGIN: called CC=1 SCAR=2.8
Subroutine BEGIN: called CC=1 SCAR=2.8
Subroutine BEGIN: called CC=3 SCAR=17.7
Subroutine BEGIN: called CC=1 SCAR=2.8
Subroutine BEGIN: called CC=1 SCAR=2.8
Subroutine BEGIN: called CC=3 SCAR=17.7
Subroutine __ANON__: called CC=1 SCAR=2.8
Subroutine __ANON__: not called CC=1 SCAR=2.8
Subroutine __ANON__: not called CC=1 SCAR=2.8
Subroutine __entry_for: called CC=1 SCAR=2.8
Subroutine __modify_entry_for: called CC=6 SCAR=28.7
Subroutine _accepts: not called CC=1 SCAR=2.8
Subroutine _accepts: not called CC=7 SCAR=31.3
Subroutine _blank_carp: not called CC=1 SCAR=2.8
Subroutine _clone: not called CC=1 SCAR=2.8
Subroutine _clone: called CC=5 SCAR=25.7
Subroutine _find_magic_vstring: called CC=4 SCAR=22.1
Subroutine _isa_version: called CC=2 SCAR=11.9
Subroutine _new: not called CC=1 SCAR=2.8
Subroutine _self: not called CC=2 SCAR=11.9
Subroutine _simplify: called CC=12 SCAR=40.7
Subroutine _version_object: called CC=14 SCAR=43.5
Subroutine accepts_module: not called CC=2 SCAR=11.9
Subroutine add_minimum: called CC=5 SCAR=25.7
Subroutine add_requirements: not called CC=3 SCAR=17.7
Subroutine add_string_requirement: called CC=8 SCAR=33.5
Subroutine as_modifiers: not called CC=1 SCAR=2.8
Subroutine as_modifiers: not called CC=4 SCAR=22.1
Subroutine as_string: not called CC=1 SCAR=2.8
Subroutine as_string: called CC=8 SCAR=33.5
Subroutine as_string_hash: called CC=1 SCAR=2.8
Subroutine clear_requirement: not called CC=3 SCAR=17.7
Subroutine clone: not called CC=1 SCAR=2.8
Subroutine finalize: not called CC=1 SCAR=2.8
Subroutine from_string_hash: not called CC=4 SCAR=22.1
Subroutine is_finalized: called CC=1 SCAR=2.8
Subroutine is_simple: not called CC=3 SCAR=17.7
Subroutine new: called CC=3 SCAR=17.7
Subroutine required_modules: called CC=1 SCAR=2.8
Subroutine requirements_for_module: not called CC=2 SCAR=11.9
Subroutine with_exact_version: not called CC=2 SCAR=11.9
Subroutine with_exact_version: not called CC=2 SCAR=11.9
Subroutine with_exclusion: not called CC=2 SCAR=11.9
Subroutine with_exclusion: not called CC=2 SCAR=11.9
Subroutine with_maximum: not called CC=2 SCAR=11.9
Subroutine with_maximum: not called CC=2 SCAR=11.9
Subroutine with_minimum: not called CC=2 SCAR=11.9
Subroutine with_minimum: called CC=2 SCAR=11.9
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Branch: 58 branches
BranchTrueFalseTotal
if (my $err = $@) 0 2 2
eval "use ExtUtils::MakeMaker::version" or die $err 0 0 0
$type eq 'exact_version' ? : 2 4 6
if $fin and not $old 0 50 50
if $fin and $old->as_string ne $new->as_string 0 50 50
if defined $self->{"minimum"} and $version < $self->{"minimum"} 0 0 0
if defined $self->{"maximum"} and $version > $self->{"maximum"} 0 0 0
if defined $self->{"exclusions"} and grep {$version == $_;} @{$$self{"exclusions"};} 0 0 0
unless ref $_[0] 260 0 260
exists $s->{'minimum'} ? : 0 0 0
exists $s->{'maximum'} ? : 0 0 0
exists $s->{'exclusions'} ? : 0 0 0
ref $sv eq 'B::PVMG' ? : 0 260 260
if ($magic) 0 260 260
if ($magic->TYPE eq 'V') { } 0 0 0
UNIVERSAL::isa($_[0], "UNIVERSAL") and $_[0]->isa("version") 50 0 50
ref $_[0] ? : 0 0 0
if (defined $self->{"minimum"} and defined $self->{"maximum"}) 0 260 260
if ($self->{"minimum"} == $self->{"maximum"}) 0 0 0
if grep {$_ == $self->{"minimum"};} @{$self->{"exclusions"} or [];} 0 0 0
if $self->{"minimum"} > $self->{"maximum"} 0 0 0
if ($self->{"exclusions"}) 0 260 260
if (not defined $version or not ref $version and $version eq '0') { } 0 50 50
elsif (ref $version eq 'version' or _isa_version($version)) { } 0 50 50
if ($INC{"version/vpp.pm"} or $INC{"ExtUtils/MakeMaker/version/vpp.pm"}) 0 50 50
if length $magic 0 0 0
if (my $err = $@) 0 50 50
if ref $hook eq "CODE" 0 0 0
unless (eval { do { $vobj->isa("version") } }) 0 0 0
if ($vobj =~ /\A\./) 0 50 50
if (_is_qv($vobj)) 0 50 50
unless my $range = $self->__entry_for($module) 0 0 0
if (not defined $version or "$version" eq '0') { } 210 50 260
if $self->__entry_for($name) 0 210 210
if $self->is_finalized 0 210 210
unless (defined $req and length $req) 0 260 260
if (length $magic) 0 260 260
if (not defined $op) { } 260 0 260
unless my $methods = $methods_for_op{$op} 0 0 0
if exists $self->{"minimum"} 0 0 0
if exists $self->{"maximum"} 0 0 0
unless keys %$self 0 260 260
if keys %$self == 1 and exists $self->{"minimum"} 260 0 260
if (exists $self->{$k}) 0 0 0
if (@new_exclusions == @exclusions) { } 0 0 0
unless $self->__entry_for($module) 0 0 0
if $self->is_finalized 0 0 0
unless (defined $req and length $req) 0 0 0
if $self->__entry_for($module)->as_string =~ /\s/ 0 0 0
unless ref $options eq "HASH" 0 14 14
unless $entry 0 0 0
if $self->_accepts($version) 0 0 0
unless $self->_accepts($version) 0 0 0
unless $exclusion == $self->{"version"} 0 0 0
if $self->{"version"} <= $maximum 0 0 0
if (defined(my $old_max = $self->{'maximum'})) { } 0 0 0
if $self->{"version"} >= $minimum 0 0 0
if (defined(my $old_min = $self->{'minimum'})) { } 0 260 260
Condition19%13/66
$fin and not $old
!ll&&!rl&&r
5000
$old || 'CPAN::Meta::Requirements::_Range::Range'
l!l
050
$fin and $old->as_string ne $new->as_string
!ll&&!rl&&r
5000
defined $self->{"minimum"} and $version < $self->{"minimum"}
!ll&&!rl&&r
000
defined $self->{"maximum"} and $version > $self->{"maximum"}
!ll&&!rl&&r
000
defined $self->{"exclusions"} and grep {$version == $_;} @{$$self{"exclusions"};}
!ll&&!rl&&r
000
defined $self->{"minimum"} and defined $self->{"maximum"}
!ll&&!rl&&r
02600
$self->{'exclusions'} || []
l!l
00
(!defined($self->{'minimum'}) || $_ >= $self->{'minimum'}) && (!defined($self->{'maximum'}) || $_ <= $self->{'maximum'}) && !$seen{$_}++
!ll&&!rl&&r
000
!defined($self->{"minimum"}) || $_ >= $self->{"minimum"} and !defined($self->{"maximum"}) || $_ <= $self->{"maximum"}
!ll&&!rl&&r
000
not defined $self->{"minimum"} or $_ >= $self->{"minimum"}
l!l&&r!l&&!r
000
not defined $self->{"maximum"} or $_ <= $self->{"maximum"}
l!l&&r!l&&!r
000
not defined $version or not ref $version and $version eq 0
l!l&&r!l&&!r
0050
not ref $version and $version eq 0
!ll&&!rl&&r
0500
ref $version eq "version" or _isa_version($version)
l!l&&r!l&&!r
0050
$INC{"version/vpp.pm"} or $INC{"ExtUtils/MakeMaker/version/vpp.pm"}
l!l&&r!l&&!r
0050
not defined $version or "$version" eq 0
l!l&&r!l&&!r
021050
defined $req and length $req
!ll&&!rl&&r
00260
$self->{'exclusions'} || []
l!l
00
keys %$self == 1 and exists $self->{"minimum"}
!ll&&!rl&&r
00260
$self->{'exclusions'} || []
l!l
00
defined $req and length $req
!ll&&!rl&&r
000
$options ||= {}
l!l
140
$self->{"exclusions"} ||= []
l!l
00
MC/DC0%0/2
$fin and not $old
$fin not $old
MC/DC0%0/1
$old || 'CPAN::Meta::Requirements::_Range::Range'
$old
MC/DC0%0/2
$fin and $old->as_string ne $new->as_string
$fin $old->as_string ne $new->as_string
MC/DC0%0/2
defined $self->{"minimum"} and $version < $self->{"minimum"}
defined $self->{"minimum"} $version < $self->{"minimum"}
MC/DC0%0/2
defined $self->{"maximum"} and $version > $self->{"maximum"}
defined $self->{"maximum"} $version > $self->{"maximum"}
MC/DC0%0/2
defined $self->{"exclusions"} and grep {$version == $_;} @{$$self{"exclusions"};}
defined $self->{"exclusions"} grep {$version == $_;} @{$$self{"exclusions"};}
MC/DC0%0/2
defined $self->{"minimum"} and defined $self->{"maximum"}
defined $self->{"minimum"} defined $self->{"maximum"}
MC/DC0%0/1
$self->{'exclusions'} || []
$self->{'exclusions'}
MC/DC0%0/5
(!defined($self->{'minimum'}) || $_ >= $self->{'minimum'}) && (!defined($self->{'maximum'}) || $_ <= $self->{'maximum'}) && !$seen{$_}++
not defined $self->{"minimum"} $_ >= $self->{"minimum"} not defined $self->{"maximum"} $_ <= $self->{"maximum"} !$seen{$_}++
MC/DC0%0/3
not defined $version or not ref $version and $version eq 0
not defined $version not ref $version $version eq 0
MC/DC0%0/2
ref $version eq "version" or _isa_version($version)
ref $version eq "version" _isa_version($version)
MC/DC0%0/2
$INC{"version/vpp.pm"} or $INC{"ExtUtils/MakeMaker/version/vpp.pm"}
$INC{"version/vpp.pm"} $INC{"ExtUtils/MakeMaker/version/vpp.pm"}
MC/DC50%1/2
not defined $version or "$version" eq 0
not defined $version "$version" eq 0
MC/DC0%0/2
defined $req and length $req
defined $req length $req
MC/DC0%0/1
$self->{'exclusions'} || []
$self->{'exclusions'}
MC/DC0%0/2
keys %$self == 1 and exists $self->{"minimum"}
keys %$self == 1 exists $self->{"minimum"}
MC/DC0%0/1
$self->{'exclusions'} || []
$self->{'exclusions'}
MC/DC0%0/2
defined $req and length $req
defined $req length $req
MC/DC0%0/1
$options ||= {}
$options
MC/DC0%0/1
$self->{"exclusions"} ||= []
$self->{"exclusions"}
Truth table33%1/3
A and not(B)
A= $finB= not $old
ABresult
0X0
100
111
Truth table50%1/2
A
A= $old
Aresult
11
00
Truth table33%1/3
A and B
A= $finB= $old->as_string ne $new->as_string
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $self->{"minimum"}B= $version < $self->{"minimum"}
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $self->{"maximum"}B= $version > $self->{"maximum"}
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $self->{"exclusions"}B= grep {$version == $_;} @{$$self{"exclusions"};}
ABresult
0X0
100
111
Truth table33%1/3
A and B
A= defined $self->{"minimum"}B= defined $self->{"maximum"}
ABresult
0X0
100
111
Truth table0%0/2
A
A= $self->{'exclusions'}
Aresult
11
00
Truth table0%0/11
not(A) or B and not(C) or D && not(E)
A= not defined $self->{"minimum"}B= $_ >= $self->{"minimum"}C= not defined $self->{"maximum"}D= $_ <= $self->{"maximum"}E= !$seen{$_}++
ABCDEresult
00XXX0
1X00X0
0100X0
1X1X00
1X0100
011X00
010100
1X1X11
1X0111
011X11
010111
Truth table25%1/4
not(A) or not(B) and C
A= not defined $versionB= not ref $versionC= $version eq 0
ABCresult
1XX1
0111
00X0
0100
Truth table33%1/3
A or B
A= ref $version eq "version"B= _isa_version($version)
ABresult
1X1
011
000
Truth table33%1/3
A or B
A= $INC{"version/vpp.pm"}B= $INC{"ExtUtils/MakeMaker/version/vpp.pm"}
ABresult
1X1
011
000
Truth table66%2/3
not(A) or B
A= not defined $versionB= "$version" eq 0
ABresult
1X1
011
000
Truth table33%1/3
A and B
A= defined $reqB= length $req
ABresult
0X0
100
111
Truth table0%0/2
A
A= $self->{'exclusions'}
Aresult
11
00
Truth table33%1/3
A and B
A= keys %$self == 1B= exists $self->{"minimum"}
ABresult
0X0
100
111
Truth table0%0/2
A
A= $self->{'exclusions'}
Aresult
11
00
Truth table0%0/3
A and B
A= defined $reqB= length $req
ABresult
0X0
100
111
Truth table50%1/2
A
A= $options
Aresult
11
00
Truth table0%0/2
A
A= $self->{"exclusions"}
Aresult
11
00
179 CPAN_META_REQUIREMENTS
180  
181 2 $fatpacked{"CPAN/Meta/Spec.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'CPAN_META_SPEC';
182 use 5.006;use strict;use warnings;package CPAN::Meta::Spec;our$VERSION='2.150005';1;
183 CPAN_META_SPEC
184  
185 2 $fatpacked{"CPAN/Meta/Validator.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'CPAN_META_VALIDATOR';
186 0 ▶ use 5.006;use strict;use warnings;package CPAN::Meta::Validator;our$VERSION='2.150005';my%known_specs=('1.4'=>'http://module-build.sourceforge.net/META-spec-v1.4.html','1.3'=>'http://module-build.sourceforge.net/META-spec-v1.3.html','1.2'=>'http://module-build.sourceforge.net/META-spec-v1.2.html','1.1'=>'http://module-build.sourceforge.net/META-spec-v1.1.html','1.0'=>'http://module-build.sourceforge.net/META-spec-v1.0.html');my%known_urls=map {$known_specs{$_}=>$_}keys%known_specs;my$module_map1={'map'=>{':key'=>{name=>\&module,value=>\&exversion }}};my$module_map2={'map'=>{':key'=>{name=>\&module,value=>\&version }}};my$no_index_2={'map'=>{file=>{list=>{value=>\&string }},directory=>{list=>{value=>\&string }},'package'=>{list=>{value=>\&string }},namespace=>{list=>{value=>\&string }},':key'=>{name=>\&custom_2,value=>\&anything },}};my$no_index_1_3={'map'=>{file=>{list=>{value=>\&string }},directory=>{list=>{value=>\&string }},'package'=>{list=>{value=>\&string }},namespace=>{list=>{value=>\&string }},':key'=>{name=>\&string,value=>\&anything },}};my$no_index_1_2={'map'=>{file=>{list=>{value=>\&string }},dir=>{list=>{value=>\&string }},'package'=>{list=>{value=>\&string }},namespace=>{list=>{value=>\&string }},':key'=>{name=>\&string,value=>\&anything },}};my$no_index_1_1={'map'=>{':key'=>{name=>\&string,list=>{value=>\&string }},}};my$prereq_map={map=>{':key'=>{name=>\&phase,'map'=>{':key'=>{name=>\&relation,%$module_map1,},},}},};my%definitions=('2'=>{'abstract'=>{mandatory=>1,value=>\&string },'author'=>{mandatory=>1,list=>{value=>\&string }},'dynamic_config'=>{mandatory=>1,value=>\&boolean },'generated_by'=>{mandatory=>1,value=>\&string },'license'=>{mandatory=>1,list=>{value=>\&license }},'meta-spec'=>{mandatory=>1,'map'=>{version=>{mandatory=>1,value=>\&version},url=>{value=>\&url },':key'=>{name=>\&custom_2,value=>\&anything },}},'name'=>{mandatory=>1,value=>\&string },'release_status'=>{mandatory=>1,value=>\&release_status },'version'=>{mandatory=>1,value=>\&version },'description'=>{value=>\&string },'keywords'=>{list=>{value=>\&string }},'no_index'=>$no_index_2,'optional_features'=>{'map'=>{':key'=>{name=>\&string,'map'=>{description=>{value=>\&string },prereqs=>$prereq_map,':key'=>{name=>\&custom_2,value=>\&anything },}}}},'prereqs'=>$prereq_map,'provides'=>{'map'=>{':key'=>{name=>\&module,'map'=>{file=>{mandatory=>1,value=>\&file },version=>{value=>\&version },':key'=>{name=>\&custom_2,value=>\&anything },}}}},'resources'=>{'map'=>{license=>{list=>{value=>\&url }},homepage=>{value=>\&url },bugtracker=>{'map'=>{web=>{value=>\&url },mailto=>{value=>\&string},':key'=>{name=>\&custom_2,value=>\&anything },}},repository=>{'map'=>{web=>{value=>\&url },url=>{value=>\&url },type=>{value=>\&string },':key'=>{name=>\&custom_2,value=>\&anything },}},':key'=>{value=>\&string,name=>\&custom_2 },}},':key'=>{name=>\&custom_2,value=>\&anything },},'1.4'=>{'meta-spec'=>{mandatory=>1,'map'=>{version=>{mandatory=>1,value=>\&version},url=>{mandatory=>1,value=>\&urlspec },':key'=>{name=>\&string,value=>\&anything },},},'name'=>{mandatory=>1,value=>\&string },'version'=>{mandatory=>1,value=>\&version },'abstract'=>{mandatory=>1,value=>\&string },'author'=>{mandatory=>1,list=>{value=>\&string }},'license'=>{mandatory=>1,value=>\&license },'generated_by'=>{mandatory=>1,value=>\&string },'distribution_type'=>{value=>\&string },'dynamic_config'=>{value=>\&boolean },'requires'=>$module_map1,'recommends'=>$module_map1,'build_requires'=>$module_map1,'configure_requires'=>$module_map1,'conflicts'=>$module_map2,'optional_features'=>{'map'=>{':key'=>{name=>\&string,'map'=>{description=>{value=>\&string },requires=>$module_map1,recommends=>$module_map1,build_requires=>$module_map1,conflicts=>$module_map2,':key'=>{name=>\&string,value=>\&anything },}}}},'provides'=>{'map'=>{':key'=>{name=>\&module,'map'=>{file=>{mandatory=>1,value=>\&file },version=>{value=>\&version },':key'=>{name=>\&string,value=>\&anything },}}}},'no_index'=>$no_index_1_3,'private'=>$no_index_1_3,'keywords'=>{list=>{value=>\&string }},'resources'=>{'map'=>{license=>{value=>\&url },homepage=>{value=>\&url },bugtracker=>{value=>\&url },repository=>{value=>\&url },':key'=>{value=>\&string,name=>\&custom_1 },}},':key'=>{name=>\&string,value=>\&anything },},'1.3'=>{'meta-spec'=>{mandatory=>1,'map'=>{version=>{mandatory=>1,value=>\&version},url=>{mandatory=>1,value=>\&urlspec },':key'=>{name=>\&string,value=>\&anything },},},'name'=>{mandatory=>1,value=>\&string },'version'=>{mandatory=>1,value=>\&version },'abstract'=>{mandatory=>1,value=>\&string },'author'=>{mandatory=>1,list=>{value=>\&string }},'license'=>{mandatory=>1,value=>\&license },'generated_by'=>{mandatory=>1,value=>\&string },'distribution_type'=>{value=>\&string },'dynamic_config'=>{value=>\&boolean },'requires'=>$module_map1,'recommends'=>$module_map1,'build_requires'=>$module_map1,'conflicts'=>$module_map2,'optional_features'=>{'map'=>{':key'=>{name=>\&string,'map'=>{description=>{value=>\&string },requires=>$module_map1,recommends=>$module_map1,build_requires=>$module_map1,conflicts=>$module_map2,':key'=>{name=>\&string,value=>\&anything },}}}},'provides'=>{'map'=>{':key'=>{name=>\&module,'map'=>{file=>{mandatory=>1,value=>\&file },version=>{value=>\&version },':key'=>{name=>\&string,value=>\&anything },}}}},'no_index'=>$no_index_1_3,'private'=>$no_index_1_3,'keywords'=>{list=>{value=>\&string }},'resources'=>{'map'=>{license=>{value=>\&url },homepage=>{value=>\&url },bugtracker=>{value=>\&url },repository=>{value=>\&url },':key'=>{value=>\&string,name=>\&custom_1 },}},':key'=>{name=>\&string,value=>\&anything },},'1.2'=>{'meta-spec'=>{mandatory=>1,'map'=>{version=>{mandatory=>1,value=>\&version},url=>{mandatory=>1,value=>\&urlspec },':key'=>{name=>\&string,value=>\&anything },},},'name'=>{mandatory=>1,value=>\&string },'version'=>{mandatory=>1,value=>\&version },'license'=>{mandatory=>1,value=>\&license },'generated_by'=>{mandatory=>1,value=>\&string },'author'=>{mandatory=>1,list=>{value=>\&string }},'abstract'=>{mandatory=>1,value=>\&string },'distribution_type'=>{value=>\&string },'dynamic_config'=>{value=>\&boolean },'keywords'=>{list=>{value=>\&string }},'private'=>$no_index_1_2,'$no_index'=>$no_index_1_2,'requires'=>$module_map1,'recommends'=>$module_map1,'build_requires'=>$module_map1,'conflicts'=>$module_map2,'optional_features'=>{'map'=>{':key'=>{name=>\&string,'map'=>{description=>{value=>\&string },requires=>$module_map1,recommends=>$module_map1,build_requires=>$module_map1,conflicts=>$module_map2,':key'=>{name=>\&string,value=>\&anything },}}}},'provides'=>{'map'=>{':key'=>{name=>\&module,'map'=>{file=>{mandatory=>1,value=>\&file },version=>{value=>\&version },':key'=>{name=>\&string,value=>\&anything },}}}},'resources'=>{'map'=>{license=>{value=>\&url },homepage=>{value=>\&url },bugtracker=>{value=>\&url },repository=>{value=>\&url },':key'=>{value=>\&string,name=>\&custom_1 },}},':key'=>{name=>\&string,value=>\&anything },},'1.1'=>{'name'=>{value=>\&string },'version'=>{mandatory=>1,value=>\&version },'license'=>{value=>\&license },'generated_by'=>{value=>\&string },'license_uri'=>{value=>\&url },'distribution_type'=>{value=>\&string },'dynamic_config'=>{value=>\&boolean },'private'=>$no_index_1_1,'requires'=>$module_map1,'recommends'=>$module_map1,'build_requires'=>$module_map1,'conflicts'=>$module_map2,':key'=>{name=>\&string,value=>\&anything },},'1.0'=>{'name'=>{value=>\&string },'version'=>{mandatory=>1,value=>\&version },'license'=>{value=>\&license },'generated_by'=>{value=>\&string },'license_uri'=>{value=>\&url },'distribution_type'=>{value=>\&string },'dynamic_config'=>{value=>\&boolean },'requires'=>$module_map1,'recommends'=>$module_map1,'build_requires'=>$module_map1,'conflicts'=>$module_map2,':key'=>{name=>\&string,value=>\&anything },},);sub new {my ($class,$data)=@_;my$self={'data'=>$data,'spec'=>eval {$data->{'meta-spec'}{'version'}}|| "1.0",'errors'=>undef,};return bless$self,$class}sub is_valid {my$self=shift;my$data=$self->{data};my$spec_version=$self->{spec};$self->check_map($definitions{$spec_version},$data);return!$self->errors}sub errors {my$self=shift;return ()unless(defined$self->{errors});return @{$self->{errors}}}my$spec_error="Missing validation action in specification. " ."Must be one of 'map', 'list', or 'value'";sub check_map {my ($self,$spec,$data)=@_;if(ref($spec)ne 'HASH'){$self->_error("Unknown META specification, cannot validate.");return}if(ref($data)ne 'HASH'){$self->_error("Expected a map structure from string or file.");return}for my$key (keys %$spec){next unless($spec->{$key}->{mandatory});next if(defined$data->{$key});push @{$self->{stack}},$key;$self->_error("Missing mandatory field, '$key'");pop @{$self->{stack}}}for my$key (keys %$data){push @{$self->{stack}},$key;if($spec->{$key}){if($spec->{$key}{value}){$spec->{$key}{value}->($self,$key,$data->{$key})}elsif($spec->{$key}{'map'}){$self->check_map($spec->{$key}{'map'},$data->{$key})}elsif($spec->{$key}{'list'}){$self->check_list($spec->{$key}{'list'},$data->{$key})}else {$self->_error("$spec_error for '$key'")}}elsif ($spec->{':key'}){$spec->{':key'}{name}->($self,$key,$key);if($spec->{':key'}{value}){$spec->{':key'}{value}->($self,$key,$data->{$key})}elsif($spec->{':key'}{'map'}){$self->check_map($spec->{':key'}{'map'},$data->{$key})}elsif($spec->{':key'}{'list'}){$self->check_list($spec->{':key'}{'list'},$data->{$key})}else {$self->_error("$spec_error for ':key'")}}else {$self->_error("Unknown key, '$key', found in map structure")}pop @{$self->{stack}}}}sub check_list {my ($self,$spec,$data)=@_;if(ref($data)ne 'ARRAY'){$self->_error("Expected a list structure");return}if(defined$spec->{mandatory}){if(!defined$data->[0]){$self->_error("Missing entries from mandatory list")}}for my$value (@$data){push @{$self->{stack}},$value || "<undef>";if(defined$spec->{value}){$spec->{value}->($self,'list',$value)}elsif(defined$spec->{'map'}){$self->check_map($spec->{'map'},$value)}elsif(defined$spec->{'list'}){$self->check_list($spec->{'list'},$value)}elsif ($spec->{':key'}){$self->check_map($spec,$value)}else {$self->_error("$spec_error associated with '$self->{stack}[-2]'")}pop @{$self->{stack}}}}sub header {my ($self,$key,$value)=@_;if(defined$value){return 1 if($value && $value =~ /^--- #YAML:1.0/)}$self->_error("file does not have a valid YAML header.");return 0}sub release_status {my ($self,$key,$value)=@_;if(defined$value){my$version=$self->{data}{version}|| '';if ($version =~ /_/){return 1 if ($value =~ /\A(?:testing|unstable)\z/);$self->_error("'$value' for '$key' is invalid for version '$version'")}else {return 1 if ($value =~ /\A(?:stable|testing|unstable)\z/);$self->_error("'$value' for '$key' is invalid")}}else {$self->_error("'$key' is not defined")}return 0}sub _uri_split {return $_[0]=~ m,(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?,}sub url {my ($self,$key,$value)=@_;if(defined$value){my ($scheme,$auth,$path,$query,$frag)=_uri_split($value);unless (defined$scheme && length$scheme){$self->_error("'$value' for '$key' does not have a URL scheme");return 0}unless (defined$auth && length$auth){$self->_error("'$value' for '$key' does not have a URL authority");return 0}return 1}$value ||= '';$self->_error("'$value' for '$key' is not a valid URL.");return 0}sub urlspec {my ($self,$key,$value)=@_;if(defined$value){return 1 if($value && $known_specs{$self->{spec}}eq $value);if($value && $known_urls{$value}){$self->_error('META specification URL does not match version');return 0}}$self->_error('Unknown META specification');return 0}sub anything {return 1}sub string {my ($self,$key,$value)=@_;if(defined$value){return 1 if($value || $value =~ /^0$/)}$self->_error("value is an undefined string");return 0}sub string_or_undef {my ($self,$key,$value)=@_;return 1 unless(defined$value);return 1 if($value || $value =~ /^0$/);$self->_error("No string defined for '$key'");return 0}sub file {my ($self,$key,$value)=@_;return 1 if(defined$value);$self->_error("No file defined for '$key'");return 0}sub exversion {my ($self,$key,$value)=@_;if(defined$value && ($value || $value =~ /0/)){my$pass=1;for(split(",",$value)){$self->version($key,$_)or ($pass=0)}return$pass}$value='<undef>' unless(defined$value);$self->_error("'$value' for '$key' is not a valid version.");return 0}sub version {my ($self,$key,$value)=@_;if(defined$value){return 0 unless($value || $value =~ /0/);return 1 if($value =~ /^\s*((<|<=|>=|>|!=|==)\s*)?v?\d+((\.\d+((_|\.)\d+)?)?)/)}else {$value='<undef>'}$self->_error("'$value' for '$key' is not a valid version.");return 0}sub boolean {my ($self,$key,$value)=@_;if(defined$value){return 1 if($value =~ /^(0|1|true|false)$/)}else {$value='<undef>'}$self->_error("'$value' for '$key' is not a boolean value.");return 0}my%v1_licenses=('perl'=>'http://dev.perl.org/licenses/','gpl'=>'http://www.opensource.org/licenses/gpl-license.php','apache'=>'http://apache.org/licenses/LICENSE-2.0','artistic'=>'http://opensource.org/licenses/artistic-license.php','artistic_2'=>'http://opensource.org/licenses/artistic-license-2.0.php','lgpl'=>'http://www.opensource.org/licenses/lgpl-license.php','bsd'=>'http://www.opensource.org/licenses/bsd-license.php','gpl'=>'http://www.opensource.org/licenses/gpl-license.php','mit'=>'http://opensource.org/licenses/mit-license.php','mozilla'=>'http://opensource.org/licenses/mozilla1.1.php','open_source'=>undef,'unrestricted'=>undef,'restrictive'=>undef,'unknown'=>undef,);my%v2_licenses=map {$_=>1}qw(agpl_3 apache_1_1 apache_2_0 artistic_1 artistic_2 bsd freebsd gfdl_1_2 gfdl_1_3 gpl_1 gpl_2 gpl_3 lgpl_2_1 lgpl_3_0 mit mozilla_1_0 mozilla_1_1 openssl perl_5 qpl_1_0 ssleay sun zlib open_source restricted unrestricted unknown);sub license {my ($self,$key,$value)=@_;my$licenses=$self->{spec}< 2 ? \%v1_licenses : \%v2_licenses;if(defined$value){return 1 if($value && exists$licenses->{$value})}else {$value='<undef>'}$self->_error("License '$value' is invalid");return 0}sub custom_1 {my ($self,$key)=@_;if(defined$key){return 1 if($key && $key =~ /^[_a-z]+$/i && $key =~ /[A-Z]/)}else {$key='<undef>'}$self->_error("Custom resource '$key' must be in CamelCase.");return 0}sub custom_2 {my ($self,$key)=@_;if(defined$key){return 1 if($key && $key =~ /^x_/i)}else {$key='<undef>'}$self->_error("Custom key '$key' must begin with 'x_' or 'X_'.");return 0}sub identifier {my ($self,$key)=@_;if(defined$key){return 1 if($key && $key =~ /^([a-z][_a-z]+)$/i)}else {$key='<undef>'}$self->_error("Key '$key' is not a legal identifier.");return 0}sub module {my ($self,$key)=@_;if(defined$key){return 1 if($key && $key =~ /^[A-Za-z0-9_]+(::[A-Za-z0-9_]+)*$/)}else {$key='<undef>'}$self->_error("Key '$key' is not a legal module name.");return 0}my@valid_phases=qw/configure build test runtime develop/;sub phase {my ($self,$key)=@_;if(defined$key){return 1 if(length$key && grep {$key eq $_}@valid_phases);return 1 if$key =~ /x_/i}else {$key='<undef>'}$self->_error("Key '$key' is not a legal phase.");return 0}my@valid_relations=qw/requires recommends suggests conflicts/;sub relation {my ($self,$key)=@_;if(defined$key){return 1 if(length$key && grep {$key eq $_}@valid_relations);return 1 if$key =~ /x_/i}else {$key='<undef>'}$self->_error("Key '$key' is not a legal prereq relationship.");return 0}sub _error {my$self=shift;my$mess=shift;$mess .= ' ('.join(' -> ',@{$self->{stack}}).')' if($self->{stack});$mess .= " [Validation: $self->{spec}]";push @{$self->{errors}},$mess}1;
Subroutine BEGIN: called CC=1 SCAR=1.8
Subroutine BEGIN: called CC=1 SCAR=1.8
Subroutine BEGIN: called CC=1 SCAR=1.8
Subroutine _error: not called CC=2 SCAR=10.3
Subroutine _uri_split: called CC=1 SCAR=1.8
Subroutine anything: called CC=1 SCAR=1.8
Subroutine boolean: called CC=3 SCAR=15.7
Subroutine check_list: called CC=10 SCAR=34.0
Subroutine check_map: called CC=15 SCAR=41.0
Subroutine custom_1: not called CC=5 SCAR=23.0
Subroutine custom_2: called CC=4 SCAR=19.7
Subroutine errors: called CC=2 SCAR=10.3
Subroutine exversion: called CC=7 SCAR=28.2
Subroutine file: called CC=2 SCAR=10.3
Subroutine header: not called CC=4 SCAR=19.7
Subroutine identifier: not called CC=4 SCAR=19.7
Subroutine is_valid: called CC=1 SCAR=1.8
Subroutine license: called CC=5 SCAR=23.0
Subroutine module: called CC=4 SCAR=19.7
Subroutine new: called CC=2 SCAR=10.3
Subroutine phase: called CC=5 SCAR=23.0
Subroutine relation: called CC=5 SCAR=23.0
Subroutine release_status: called CC=6 SCAR=25.8
Subroutine string: called CC=4 SCAR=19.7
Subroutine string_or_undef: not called CC=4 SCAR=19.7
Subroutine url: called CC=7 SCAR=28.2
Subroutine urlspec: not called CC=6 SCAR=25.8
Subroutine version: called CC=5 SCAR=23.0
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod documented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod documented
Pod undocumented
Pod undocumented
Pod documented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Branch: 63 branches
BranchTrueFalseTotal
if $self->{"stack"} 0 0 0
if (defined $value) { } 2 0 2
if $value =~ /^(0|1|true|false)$/ 2 0 2
if (ref $data ne "ARRAY") 0 6 6
if (defined $spec->{"mandatory"}) 0 6 6
unless (defined $data->[0]) 0 0 0
if (defined $spec->{'value'}) { } 16 0 16
elsif (defined $spec->{'map'}) { } 0 0 0
elsif (defined $spec->{'list'}) { } 0 0 0
elsif ($spec->{':key'}) { } 0 0 0
if (ref $spec ne "HASH") 0 310 310
if (ref $data ne "HASH") 0 310 310
unless $spec->{$key}{"mandatory"} 622 290 912
if defined $data->{$key} 290 0 290
if ($spec->{$key}) { } 586 558 1144
elsif ($spec->{':key'}) { } 558 0 558
if ($spec->{$key}{'value'}) { } 566 20 586
elsif ($spec->{$key}{'map'}) { } 14 6 20
elsif ($spec->{$key}{'list'}) { } 6 0 6
if ($spec->{':key'}{'value'}) { } 264 294 558
elsif ($spec->{':key'}{'map'}) { } 294 0 294
elsif ($spec->{':key'}{'list'}) { } 0 0 0
if (defined $key) { } 0 0 0
if $key and $key =~ /^[_a-z]+$/i and $key =~ /[A-Z]/ 0 0 0
if (defined $key) { } 4 0 4
if $key and $key =~ /^x_/i 4 0 4
unless defined $self->{"errors"} 2 0 2
if (defined $value and $value || $value =~ /0/) 260 0 260
$self->version($key, $_) or $pass = 0 260 0 260
unless defined $value 0 0 0
if defined $value 270 0 270
if (defined $value) 0 0 0
if $value and $value =~ /^--- #YAML:1.0/ 0 0 0
if (defined $key) { } 0 0 0
if $key and $key =~ /^([a-z][_a-z]+)$/i 0 0 0
$self->{'spec'} < 2 ? : 0 2 2
if (defined $value) { } 2 0 2
if $value and exists $licenses->{$value} 2 0 2
if (defined $key) { } 530 0 530
if $key and $key =~ /^[A-Za-z0-9_]+(::[A-Za-z0-9_]+)*$/ 530 0 530
if (defined $key) { } 10 0 10
if length $key and grep {$key eq $_;} @valid_phases 10 0 10
if $key =~ /x_/i 0 0 0
if (defined $key) { } 14 0 14
if length $key and grep {$key eq $_;} @valid_relations 14 0 14
if $key =~ /x_/i 0 0 0
if (defined $value) { } 2 0 2
if ($version =~ /_/) { } 0 2 2
if $value =~ /\A(?:testing|unstable)\z/ 0 0 0
if $value =~ /\A(?:stable|testing|unstable)\z/ 2 0 2
if (defined $value) 22 0 22
if $value or $value =~ /^0$/ 22 0 22
unless defined $value 0 0 0
if $value or $value =~ /^0$/ 0 0 0
if (defined $value) 10 0 10
unless (defined $scheme and length $scheme) 0 10 10
unless (defined $auth and length $auth) 0 10 10
if (defined $value) 0 0 0
if $value and $known_specs{$self->{"spec"}} eq $value 0 0 0
if ($value and $known_urls{$value}) 0 0 0
if (defined $value) { } 534 0 534
unless $value or $value =~ /0/ 0 534 534
if $value =~ /^\s*((<|<=|>=|>|!=|==)\s*)?v?\d+((\.\d+((_|\.)\d+)?)?)/ 534 0 534
Condition25%16/62
$value || '<undef>'
l!l
160
$key and $key =~ /^[_a-z]+$/i and $key =~ /[A-Z]/
!ll&&!rl&&r
000
$key and $key =~ /^[_a-z]+$/i
!ll&&!rl&&r
000
$key and $key =~ /^x_/i
!ll&&!rl&&r
004
defined $value and $value || $value =~ /0/
!ll&&!rl&&r
00260
$value or $value =~ /0/
l!l&&r!l&&!r
502100
$value and $value =~ /^--- #YAML:1.0/
!ll&&!rl&&r
000
$key and $key =~ /^([a-z][_a-z]+)$/i
!ll&&!rl&&r
000
$value and exists $licenses->{$value}
!ll&&!rl&&r
002
$key and $key =~ /^[A-Za-z0-9_]+(::[A-Za-z0-9_]+)*$/
!ll&&!rl&&r
00530
eval { do { $data->{'meta-spec'}{'version'} } } || '1.0'
l!l
20
length $key and grep {$key eq $_;} @valid_phases
!ll&&!rl&&r
0010
length $key and grep {$key eq $_;} @valid_relations
!ll&&!rl&&r
0014
$self->{'data'}{'version'} || ''
l!l
20
$value or $value =~ /^0$/
l!l&&r!l&&!r
2200
$value or $value =~ /^0$/
l!l&&r!l&&!r
000
defined $scheme and length $scheme
!ll&&!rl&&r
0010
defined $auth and length $auth
!ll&&!rl&&r
0010
$value ||= ""
l!l
00
$value and $known_specs{$self->{"spec"}} eq $value
!ll&&!rl&&r
000
$value and $known_urls{$value}
!ll&&!rl&&r
000
$value or $value =~ /0/
l!l&&r!l&&!r
3242100
MC/DC0%0/1
$value || '<undef>'
$value
MC/DC0%0/3
$key and $key =~ /^[_a-z]+$/i and $key =~ /[A-Z]/
$key $key =~ /^[_a-z]+$/i $key =~ /[A-Z]/
MC/DC0%0/2
$key and $key =~ /^x_/i
$key $key =~ /^x_/i
MC/DC0%0/3
defined $value and $value || $value =~ /0/
defined $value $value $value =~ /0/
MC/DC0%0/2
$value and $value =~ /^--- #YAML:1.0/
$value $value =~ /^--- #YAML:1.0/
MC/DC0%0/2
$key and $key =~ /^([a-z][_a-z]+)$/i
$key $key =~ /^([a-z][_a-z]+)$/i
MC/DC0%0/2
$value and exists $licenses->{$value}
$value exists $licenses->{$value}
MC/DC0%0/2
$key and $key =~ /^[A-Za-z0-9_]+(::[A-Za-z0-9_]+)*$/
$key $key =~ /^[A-Za-z0-9_]+(::[A-Za-z0-9_]+)*$/
MC/DC0%0/1
eval { do { $data->{'meta-spec'}{'version'} } } || '1.0'
eval { do { $data->{'meta-spec'}{'version'} } }
MC/DC0%0/2
length $key and grep {$key eq $_;} @valid_phases
length $key grep {$key eq $_;} @valid_phases
MC/DC0%0/2
length $key and grep {$key eq $_;} @valid_relations
length $key grep {$key eq $_;} @valid_relations
MC/DC0%0/1
$self->{'data'}{'version'} || ''
$self->{'data'}{'version'}
MC/DC0%0/2
$value or $value =~ /^0$/
$value $value =~ /^0$/
MC/DC0%0/2
$value or $value =~ /^0$/
$value $value =~ /^0$/
MC/DC0%0/2
defined $scheme and length $scheme
defined $scheme length $scheme
MC/DC0%0/2
defined $auth and length $auth
defined $auth length $auth
MC/DC0%0/1
$value ||= ""
$value
MC/DC0%0/2
$value and $known_specs{$self->{"spec"}} eq $value
$value $known_specs{$self->{"spec"}} eq $value
MC/DC0%0/2
$value and $known_urls{$value}
$value $known_urls{$value}
Truth table50%1/2
A
A= $value
Aresult
11
00
Truth table0%0/4
A and B and C
A= $keyB= $key =~ /^[_a-z]+$/iC= $key =~ /[A-Z]/
ABCresult
0XX0
10X0
1100
1111
Truth table33%1/3
A and B
A= $keyB= $key =~ /^x_/i
ABresult
0X0
100
111
Truth table50%2/4
A and B or C
A= defined $valueB= $valueC= $value =~ /0/
ABCresult
0XX0
1000
11X1
1011
Truth table0%0/3
A and B
A= $valueB= $value =~ /^--- #YAML:1.0/
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $keyB= $key =~ /^([a-z][_a-z]+)$/i
ABresult
0X0
100
111
Truth table33%1/3
A and B
A= $valueB= exists $licenses->{$value}
ABresult
0X0
100
111
Truth table33%1/3
A and B
A= $keyB= $key =~ /^[A-Za-z0-9_]+(::[A-Za-z0-9_]+)*$/
ABresult
0X0
100
111
Truth table50%1/2
A
A= eval { do { $data->{'meta-spec'}{'version'} } }
Aresult
11
00
Truth table33%1/3
A and B
A= length $keyB= grep {$key eq $_;} @valid_phases
ABresult
0X0
100
111
Truth table33%1/3
A and B
A= length $keyB= grep {$key eq $_;} @valid_relations
ABresult
0X0
100
111
Truth table50%1/2
A
A= $self->{'data'}{'version'}
Aresult
11
00
Truth table33%1/3
A or B
A= $valueB= $value =~ /^0$/
ABresult
1X1
011
000
Truth table0%0/3
A or B
A= $valueB= $value =~ /^0$/
ABresult
1X1
011
000
Truth table33%1/3
A and B
A= defined $schemeB= length $scheme
ABresult
0X0
100
111
Truth table33%1/3
A and B
A= defined $authB= length $auth
ABresult
0X0
100
111
Truth table0%0/2
A
A= $value
Aresult
11
00
Truth table0%0/3
A and B
A= $valueB= $known_specs{$self->{"spec"}} eq $value
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $valueB= $known_urls{$value}
ABresult
0X0
100
111
187 CPAN_META_VALIDATOR
188  
189 2 $fatpacked{"CPAN/Meta/YAML.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'CPAN_META_YAML';
190 use 5.008001;use strict;use warnings;package CPAN::Meta::YAML;$CPAN::Meta::YAML::VERSION='0.016';;use Exporter;our@ISA=qw{Exporter};our@EXPORT=qw{Load Dump};our@EXPORT_OK=qw{LoadFile DumpFile freeze thaw};sub Dump {return CPAN::Meta::YAML->new(@_)->_dump_string}sub Load {my$self=CPAN::Meta::YAML->_load_string(@_);if (wantarray){return @$self}else {return$self->[-1]}}BEGIN {*freeze=\&Dump;*thaw=\&Load}sub DumpFile {my$file=shift;return CPAN::Meta::YAML->new(@_)->_dump_file($file)}sub LoadFile {my$file=shift;my$self=CPAN::Meta::YAML->_load_file($file);if (wantarray){return @$self}else {return$self->[-1]}}sub new {my$class=shift;bless [@_ ],$class}sub read_string {my$self=shift;$self->_load_string(@_)}sub write_string {my$self=shift;$self->_dump_string(@_)}sub read {my$self=shift;$self->_load_file(@_)}sub write {my$self=shift;$self->_dump_file(@_)}my@UNPRINTABLE=qw(0 x01 x02 x03 x04 x05 x06 a b t n v f r x0E x0F x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x1A e x1C x1D x1E x1F);my%UNESCAPES=(0=>"\x00",z=>"\x00",N=>"\x85",a=>"\x07",b=>"\x08",t=>"\x09",n=>"\x0a",v=>"\x0b",f=>"\x0c",r=>"\x0d",e=>"\x1b",'\\'=>'\\',);my%QUOTE=map {$_=>1}qw{null true false};my$re_capture_double_quoted=qr/\"([^\\"]*(?:\\.[^\\"]*)*)\"/;my$re_capture_single_quoted=qr/\'([^\']*(?:\'\'[^\']*)*)\'/;my$re_capture_unquoted_key=qr/([^:]+(?::+\S(?:[^:]*|.*?(?=:)))*)(?=\s*\:(?:\s+|$))/;my$re_trailing_comment=qr/(?:\s+\#.*)?/;my$re_key_value_separator=qr/\s*:(?:\s+(?:\#.*)?|$)/;sub _load_file {my$class=ref $_[0]? ref shift : shift;my$file=shift or $class->_error('You did not specify a file name');$class->_error("File '$file' does not exist")unless -e $file;$class->_error("'$file' is a directory, not a file")unless -f _;$class->_error("Insufficient permissions to read '$file'")unless -r _;open(my$fh,"<:unix:encoding(UTF-8)",$file);unless ($fh){$class->_error("Failed to open file '$file': $!")}if (_can_flock()){flock($fh,Fcntl::LOCK_SH())or warn "Couldn't lock '$file' for reading: $!"}my$contents=eval {use warnings FATAL=>'utf8';local $/;<$fh>};if (my$err=$@){$class->_error("Error reading from file '$file': $err")}unless (close$fh){$class->_error("Failed to close file '$file': $!")}$class->_load_string($contents)}sub _load_string {my$class=ref $_[0]? ref shift : shift;my$self=bless [],$class;my$string=$_[0];eval {unless (defined$string){die \"Did not provide a string to load"}if (utf8::is_utf8($string)&&!utf8::valid($string)){die \<<'...'}utf8::upgrade($string);$string =~ s/^\x{FEFF}//;return$self unless length$string;my@lines=grep {!/^\s*(?:\#.*)?\z/}split /(?:\015{1,2}\012|\015|\012)/,$string;@lines and $lines[0]=~ /^\%YAML[: ][\d\.]+.*\z/ and shift@lines;my$in_document=0;while (@lines){if ($lines[0]=~ /^---\s*(?:(.+)\s*)?\z/){shift@lines;if (defined $1 and $1 !~ /^(?:\#.+|\%YAML[: ][\d\.]+)\z/){push @$self,$self->_load_scalar("$1",[undef ],\@lines);next}$in_document=1}if (!@lines or $lines[0]=~ /^(?:---|\.\.\.)/){push @$self,undef;while (@lines and $lines[0]!~ /^---/){shift@lines}$in_document=0}elsif (!$in_document && @$self){die \"CPAN::Meta::YAML failed to classify the line '$lines[0]'"}elsif ($lines[0]=~ /^\s*\-(?:\s|$|-+$)/){my$document=[];push @$self,$document;$self->_load_array($document,[0 ],\@lines)}elsif ($lines[0]=~ /^(\s*)\S/){my$document={};push @$self,$document;$self->_load_hash($document,[length($1)],\@lines)}else {die \"CPAN::Meta::YAML failed to classify the line '$lines[0]'"}}};my$err=$@;if (ref$err eq 'SCALAR'){$self->_error(${$err})}elsif ($err){$self->_error($err)}return$self}sub _unquote_single {my ($self,$string)=@_;return '' unless length$string;$string =~ s/\'\'/\'/g;return$string}sub _unquote_double {my ($self,$string)=@_;return '' unless length$string;$string =~ s/\\"/"/g;$string =~ s{\\([Nnever\\fartz0b]|x([0-9a-fA-F]{2}))}
191 Read an invalid UTF-8 string (maybe mixed UTF-8 and 8-bit character set).
192 Did you decode with lax ":utf8" instead of strict ":encoding(UTF-8)"?
193 ...
194 {(length($1)>1)?pack("H2",$2):$UNESCAPES{$1}}gex;return$string}sub _load_scalar {my ($self,$string,$indent,$lines)=@_;$string =~ s/\s*\z//;return undef if$string eq '~';if ($string =~ /^$re_capture_single_quoted$re_trailing_comment\z/){return$self->_unquote_single($1)}if ($string =~ /^$re_capture_double_quoted$re_trailing_comment\z/){return$self->_unquote_double($1)}if ($string =~ /^[\'\"!&]/){die \"CPAN::Meta::YAML does not support a feature in line '$string'"}return {}if$string =~ /^{}(?:\s+\#.*)?\z/;return []if$string =~ /^\[\](?:\s+\#.*)?\z/;if ($string !~ /^[>|]/){die \"CPAN::Meta::YAML found illegal characters in plain scalar: '$string'" if$string =~ /^(?:-(?:\s|$)|[\@\%\`])/ or $string =~ /:(?:\s|$)/;$string =~ s/\s+#.*\z//;return$string}die \"CPAN::Meta::YAML failed to find multi-line scalar content" unless @$lines;$lines->[0]=~ /^(\s*)/;$indent->[-1]=length("$1");if (defined$indent->[-2]and $indent->[-1]<= $indent->[-2]){die \"CPAN::Meta::YAML found bad indenting in line '$lines->[0]'"}my@multiline=();while (@$lines){$lines->[0]=~ /^(\s*)/;last unless length($1)>= $indent->[-1];push@multiline,substr(shift(@$lines),length($1))}my$j=(substr($string,0,1)eq '>')? ' ' : "\n";my$t=(substr($string,1,1)eq '-')? '' : "\n";return join($j,@multiline).$t}sub _load_array {my ($self,$array,$indent,$lines)=@_;while (@$lines){if ($lines->[0]=~ /^(?:---|\.\.\.)/){while (@$lines and $lines->[0]!~ /^---/){shift @$lines}return 1}$lines->[0]=~ /^(\s*)/;if (length($1)< $indent->[-1]){return 1}elsif (length($1)> $indent->[-1]){die \"CPAN::Meta::YAML found bad indenting in line '$lines->[0]'"}if ($lines->[0]=~ /^(\s*\-\s+)[^\'\"]\S*\s*:(?:\s+|$)/){my$indent2=length("$1");$lines->[0]=~ s/-/ /;push @$array,{};$self->_load_hash($array->[-1],[@$indent,$indent2 ],$lines)}elsif ($lines->[0]=~ /^\s*\-\s*\z/){shift @$lines;unless (@$lines){push @$array,undef;return 1}if ($lines->[0]=~ /^(\s*)\-/){my$indent2=length("$1");if ($indent->[-1]==$indent2){push @$array,undef}else {push @$array,[];$self->_load_array($array->[-1],[@$indent,$indent2 ],$lines)}}elsif ($lines->[0]=~ /^(\s*)\S/){push @$array,{};$self->_load_hash($array->[-1],[@$indent,length("$1")],$lines)}else {die \"CPAN::Meta::YAML failed to classify line '$lines->[0]'"}}elsif ($lines->[0]=~ /^\s*\-(\s*)(.+?)\s*\z/){shift @$lines;push @$array,$self->_load_scalar("$2",[@$indent,undef ],$lines)}elsif (defined$indent->[-2]and $indent->[-1]==$indent->[-2]){return 1}else {die \"CPAN::Meta::YAML failed to classify line '$lines->[0]'"}}return 1}sub _load_hash {my ($self,$hash,$indent,$lines)=@_;while (@$lines){if ($lines->[0]=~ /^(?:---|\.\.\.)/){while (@$lines and $lines->[0]!~ /^---/){shift @$lines}return 1}$lines->[0]=~ /^(\s*)/;if (length($1)< $indent->[-1]){return 1}elsif (length($1)> $indent->[-1]){die \"CPAN::Meta::YAML found bad indenting in line '$lines->[0]'"}my$key;if ($lines->[0]=~ s/^\s*$re_capture_single_quoted$re_key_value_separator//){$key=$self->_unquote_single($1)}elsif ($lines->[0]=~ s/^\s*$re_capture_double_quoted$re_key_value_separator//){$key=$self->_unquote_double($1)}elsif ($lines->[0]=~ s/^\s*$re_capture_unquoted_key$re_key_value_separator//){$key=$1;$key =~ s/\s+$//}elsif ($lines->[0]=~ /^\s*\?/){die \"CPAN::Meta::YAML does not support a feature in line '$lines->[0]'"}else {die \"CPAN::Meta::YAML failed to classify line '$lines->[0]'"}if (exists$hash->{$key}){warn "CPAN::Meta::YAML found a duplicate key '$key' in line '$lines->[0]'"}if (length$lines->[0]){$hash->{$key}=$self->_load_scalar(shift(@$lines),[@$indent,undef ],$lines)}else {shift @$lines;unless (@$lines){$hash->{$key}=undef;return 1}if ($lines->[0]=~ /^(\s*)-/){$hash->{$key}=[];$self->_load_array($hash->{$key},[@$indent,length($1)],$lines)}elsif ($lines->[0]=~ /^(\s*)./){my$indent2=length("$1");if ($indent->[-1]>= $indent2){$hash->{$key}=undef}else {$hash->{$key}={};$self->_load_hash($hash->{$key},[@$indent,length($1)],$lines)}}}}return 1}sub _dump_file {my$self=shift;require Fcntl;my$file=shift or $self->_error('You did not specify a file name');my$fh;if (_can_flock()){my$flags=Fcntl::O_WRONLY()|Fcntl::O_CREAT();sysopen($fh,$file,$flags);unless ($fh){$self->_error("Failed to open file '$file' for writing: $!")}binmode($fh,":raw:encoding(UTF-8)");flock($fh,Fcntl::LOCK_EX())or warn "Couldn't lock '$file' for reading: $!";truncate$fh,0;seek$fh,0,0}else {open$fh,">:unix:encoding(UTF-8)",$file}print {$fh}$self->_dump_string;unless (close$fh){$self->_error("Failed to close file '$file': $!")}return 1}sub _dump_string {my$self=shift;return '' unless ref$self && @$self;my$indent=0;my@lines=();eval {for my$cursor (@$self){push@lines,'---';if (!defined$cursor){}elsif (!ref$cursor){$lines[-1].= ' ' .$self->_dump_scalar($cursor)}elsif (ref$cursor eq 'ARRAY'){unless (@$cursor){$lines[-1].= ' []';next}push@lines,$self->_dump_array($cursor,$indent,{})}elsif (ref$cursor eq 'HASH'){unless (%$cursor){$lines[-1].= ' {}';next}push@lines,$self->_dump_hash($cursor,$indent,{})}else {die \("Cannot serialize " .ref($cursor))}}};if (ref $@ eq 'SCALAR'){$self->_error(${$@})}elsif ($@){$self->_error($@)}join '',map {"$_\n"}@lines}sub _has_internal_string_value {my$value=shift;my$b_obj=B::svref_2object(\$value);return$b_obj->FLAGS & B::SVf_POK()}sub _dump_scalar {my$string=$_[1];my$is_key=$_[2];my$has_string_flag=_has_internal_string_value($string);return '~' unless defined$string;return "''" unless length$string;if (Scalar::Util::looks_like_number($string)){if ($is_key || $has_string_flag){return qq['$string']}else {return$string}}if ($string =~ /[\x00-\x09\x0b-\x0d\x0e-\x1f\x7f-\x9f\'\n]/){$string =~ s/\\/\\\\/g;$string =~ s/"/\\"/g;$string =~ s/\n/\\n/g;$string =~ s/[\x85]/\\N/g;$string =~ s/([\x00-\x1f])/\\$UNPRINTABLE[ord($1)]/g;$string =~ s/([\x7f-\x9f])/'\x' . sprintf("%X",ord($1))/ge;return qq|"$string"|}if ($string =~ /(?:^[~!@#%&*|>?:,'"`{}\[\]]|^-+$|\s|:\z)/ or $QUOTE{$string}){return "'$string'"}return$string}sub _dump_array {my ($self,$array,$indent,$seen)=@_;if ($seen->{refaddr($array)}++){die \"CPAN::Meta::YAML does not support circular references"}my@lines=();for my$el (@$array){my$line=(' ' x $indent).'-';my$type=ref$el;if (!$type){$line .= ' ' .$self->_dump_scalar($el);push@lines,$line}elsif ($type eq 'ARRAY'){if (@$el){push@lines,$line;push@lines,$self->_dump_array($el,$indent + 1,$seen)}else {$line .= ' []';push@lines,$line}}elsif ($type eq 'HASH'){if (keys %$el){push@lines,$line;push@lines,$self->_dump_hash($el,$indent + 1,$seen)}else {$line .= ' {}';push@lines,$line}}else {die \"CPAN::Meta::YAML does not support $type references"}}@lines}sub _dump_hash {my ($self,$hash,$indent,$seen)=@_;if ($seen->{refaddr($hash)}++){die \"CPAN::Meta::YAML does not support circular references"}my@lines=();for my$name (sort keys %$hash){my$el=$hash->{$name};my$line=(' ' x $indent).$self->_dump_scalar($name,1).":";my$type=ref$el;if (!$type){$line .= ' ' .$self->_dump_scalar($el);push@lines,$line}elsif ($type eq 'ARRAY'){if (@$el){push@lines,$line;push@lines,$self->_dump_array($el,$indent + 1,$seen)}else {$line .= ' []';push@lines,$line}}elsif ($type eq 'HASH'){if (keys %$el){push@lines,$line;push@lines,$self->_dump_hash($el,$indent + 1,$seen)}else {$line .= ' {}';push@lines,$line}}else {die \"CPAN::Meta::YAML does not support $type references"}}@lines}our$errstr='';sub _error {require Carp;$errstr=$_[1];$errstr =~ s/ at \S+ line \d+.*//;Carp::croak($errstr)}my$errstr_warned;sub errstr {require Carp;Carp::carp("CPAN::Meta::YAML->errstr and \$CPAN::Meta::YAML::errstr is deprecated")unless$errstr_warned++;$errstr}use B;my$HAS_FLOCK;sub _can_flock {if (defined$HAS_FLOCK){return$HAS_FLOCK}else {require Config;my$c=\%Config::Config;$HAS_FLOCK=grep {$c->{$_}}qw/d_flock d_fcntl_can_lock d_lockf/;require Fcntl if$HAS_FLOCK;return$HAS_FLOCK}}use Scalar::Util ();BEGIN {local $@;if (eval {Scalar::Util->VERSION(1.18)}){*refaddr=*Scalar::Util::refaddr}else {eval <<'END_PERL'}}delete$CPAN::Meta::YAML::{refaddr};1;
195 # Scalar::Util failed to load or too old
196 sub refaddr {
197 my $pkg = ref($_[0]) or return undef;
198 if ( !! UNIVERSAL::can($_[0], 'can') ) {
199 bless $_[0], 'Scalar::Util::Fake';
200 } else {
201 $pkg = undef;
202 }
203 "$_[0]" =~ /0x(\w+)/;
204 my $i = do { no warnings 'portable'; hex $1 };
205 bless $_[0], $pkg if defined $pkg;
206 $i;
207 }
208 END_PERL
209 CPAN_META_YAML
210  
211 2 $fatpacked{"Exporter.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'EXPORTER';
212 package Exporter;require 5.006;our$Debug=0;our$ExportLevel=0;our$Verbose ||= 0;our$VERSION='5.70';our (%Cache);sub as_heavy {require Exporter::Heavy;my$c=(caller(1))[3];$c =~ s/.*:://;\&{"Exporter::Heavy::heavy_$c"}}sub export {goto &{as_heavy()}}sub import {my$pkg=shift;my$callpkg=caller($ExportLevel);if ($pkg eq "Exporter" and @_ and $_[0]eq "import"){*{$callpkg."::import"}=\&import;return}my$exports=\@{"$pkg\::EXPORT"};my$fail=${$pkg .'::'}{EXPORT_FAIL}&& \@{"$pkg\::EXPORT_FAIL"};return export$pkg,$callpkg,@_ if$Verbose or $Debug or $fail && @$fail > 1;my$export_cache=($Cache{$pkg}||= {});my$args=@_ or @_=@$exports;if ($args and not %$export_cache){s/^&//,$export_cache->{$_}=1 foreach (@$exports,@{"$pkg\::EXPORT_OK"})}my$heavy;if ($args or $fail){($heavy=(/\W/ or $args and not exists$export_cache->{$_}or $fail and @$fail and $_ eq $fail->[0]))and last foreach (@_)}else {($heavy=/\W/)and last foreach (@_)}return export$pkg,$callpkg,($args ? @_ : ())if$heavy;local$SIG{__WARN__}=sub {require Carp;&Carp::carp}if not $SIG{__WARN__};*{"$callpkg\::$_"}=\&{"$pkg\::$_"}foreach @_}sub export_fail {my$self=shift;@_}sub export_to_level {goto &{as_heavy()}}sub export_tags {goto &{as_heavy()}}sub export_ok_tags {goto &{as_heavy()}}sub require_version {goto &{as_heavy()}}1;
213 EXPORTER
214  
215 2 $fatpacked{"Exporter/Heavy.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'EXPORTER_HEAVY';
216 package Exporter::Heavy;use strict;no strict 'refs';require Exporter;our$VERSION=$Exporter::VERSION;sub _rebuild_cache {my ($pkg,$exports,$cache)=@_;s/^&// foreach @$exports;@{$cache}{@$exports}=(1)x @$exports;my$ok=\@{"${pkg}::EXPORT_OK"};if (@$ok){s/^&// foreach @$ok;@{$cache}{@$ok}=(1)x @$ok}}sub heavy_export {my$oldwarn=$SIG{__WARN__};local$SIG{__WARN__}=sub {local$SIG{__WARN__}=$oldwarn;my$text=shift;if ($text =~ s/ at \S*Exporter\S*.pm line \d+.*\n//){require Carp;local$Carp::CarpLevel=1;Carp::carp($text)}else {warn$text}};local$SIG{__DIE__}=sub {require Carp;local$Carp::CarpLevel=1;Carp::croak("$_[0]Illegal null symbol in \@${1}::EXPORT")if $_[0]=~ /^Unable to create sub named "(.*?)::"/};my($pkg,$callpkg,@imports)=@_;my($type,$sym,$cache_is_current,$oops);my($exports,$export_cache)=(\@{"${pkg}::EXPORT"},$Exporter::Cache{$pkg}||= {});if (@imports){if (!%$export_cache){_rebuild_cache ($pkg,$exports,$export_cache);$cache_is_current=1}if (grep m{^[/!:]},@imports){my$tagsref=\%{"${pkg}::EXPORT_TAGS"};my$tagdata;my%imports;my($remove,$spec,@names,@allexports);unshift@imports,':DEFAULT' if$imports[0]=~ m/^!/;for$spec (@imports){$remove=$spec =~ s/^!//;if ($spec =~ s/^://){if ($spec eq 'DEFAULT'){@names=@$exports}elsif ($tagdata=$tagsref->{$spec}){@names=@$tagdata}else {warn qq["$spec" is not defined in %${pkg}::EXPORT_TAGS];++$oops;next}}elsif ($spec =~ m:^/(.*)/$:){my$patn=$1;@allexports=keys %$export_cache unless@allexports;@names=grep(/$patn/,@allexports)}else {@names=($spec)}warn "Import ".($remove ? "del":"add").": @names " if$Exporter::Verbose;if ($remove){for$sym (@names){delete$imports{$sym}}}else {@imports{@names}=(1)x @names}}@imports=keys%imports}my@carp;for$sym (@imports){if (!$export_cache->{$sym}){if ($sym =~ m/^\d/){$pkg->VERSION($sym);if (@imports==1){@imports=@$exports;last}if (@imports==2 and!$imports[1]){@imports=();last}}elsif ($sym !~ s/^&// ||!$export_cache->{$sym}){unless ($cache_is_current){%$export_cache=();_rebuild_cache ($pkg,$exports,$export_cache);$cache_is_current=1}if (!$export_cache->{$sym}){push@carp,qq["$sym" is not exported by the $pkg module\n];$oops++}}}}if ($oops){require Carp;Carp::croak("@{carp}Can't continue after import errors")}}else {@imports=@$exports}my($fail,$fail_cache)=(\@{"${pkg}::EXPORT_FAIL"},$Exporter::FailCache{$pkg}||= {});if (@$fail){if (!%$fail_cache){my@expanded=map {/^\w/ ? ($_,'&'.$_): $_}@$fail;warn "${pkg}::EXPORT_FAIL cached: @expanded" if$Exporter::Verbose;@{$fail_cache}{@expanded}=(1)x @expanded}my@failed;for$sym (@imports){push(@failed,$sym)if$fail_cache->{$sym}}if (@failed){@failed=$pkg->export_fail(@failed);for$sym (@failed){require Carp;Carp::carp(qq["$sym" is not implemented by the $pkg module ],"on this architecture")}if (@failed){require Carp;Carp::croak("Can't continue after import errors")}}}warn "Importing into $callpkg from $pkg: ",join(", ",sort@imports)if$Exporter::Verbose;for$sym (@imports){(*{"${callpkg}::$sym"}=\&{"${pkg}::$sym"},next)unless$sym =~ s/^(\W)//;$type=$1;no warnings 'once';*{"${callpkg}::$sym"}=$type eq '&' ? \&{"${pkg}::$sym"}: $type eq '$' ? \${"${pkg}::$sym"}: $type eq '@' ? \@{"${pkg}::$sym"}: $type eq '%' ? \%{"${pkg}::$sym"}: $type eq '*' ? *{"${pkg}::$sym"}: do {require Carp;Carp::croak("Can't export symbol: $type$sym")}}}sub heavy_export_to_level {my$pkg=shift;my$level=shift;(undef)=shift;my$callpkg=caller($level);$pkg->export($callpkg,@_)}sub _push_tags {my($pkg,$var,$syms)=@_;my@nontag=();my$export_tags=\%{"${pkg}::EXPORT_TAGS"};push(@{"${pkg}::$var"},map {$export_tags->{$_}? @{$export_tags->{$_}}: scalar(push(@nontag,$_),$_)}(@$syms)? @$syms : keys %$export_tags);if (@nontag and $^W){require Carp;Carp::carp(join(", ",@nontag)." are not tags of $pkg")}}sub heavy_require_version {my($self,$wanted)=@_;my$pkg=ref$self || $self;return ${pkg}->VERSION($wanted)}sub heavy_export_tags {_push_tags((caller)[0],"EXPORT",\@_)}sub heavy_export_ok_tags {_push_tags((caller)[0],"EXPORT_OK",\@_)}1;
217 EXPORTER_HEAVY
218  
219 2 $fatpacked{"File/pushd.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'FILE_PUSHD';
220 use strict;use warnings;package File::pushd;our$VERSION='1.009';our@EXPORT=qw(pushd tempd);our@ISA=qw(Exporter);use Exporter;use Carp;use Cwd qw(getcwd abs_path);use File::Path qw(rmtree);use File::Temp qw();use File::Spec;use overload q{""}=>sub {File::Spec->canonpath($_[0]->{_pushd})},fallback=>1;sub pushd {my ($target_dir,$options)=@_;$options->{untaint_pattern}||= qr{^([-+@\w./]+)$};$target_dir="." unless defined$target_dir;croak "Can't locate directory $target_dir" unless -d $target_dir;my$tainted_orig=getcwd;my$orig;if ($tainted_orig =~ $options->{untaint_pattern}){$orig=$1}else {$orig=$tainted_orig}my$tainted_dest;eval {$tainted_dest=$target_dir ? abs_path($target_dir): $orig};croak "Can't locate absolute path for $target_dir: $@" if $@;my$dest;if ($tainted_dest =~ $options->{untaint_pattern}){$dest=$1}else {$dest=$tainted_dest}if ($dest ne $orig){chdir$dest or croak "Can't chdir to $dest\: $!"}my$self=bless {_pushd=>$dest,_original=>$orig },__PACKAGE__;return$self}sub tempd {my ($options)=@_;my$dir;eval {$dir=pushd(File::Temp::tempdir(CLEANUP=>0),$options)};croak $@ if $@;$dir->{_tempd}=1;return$dir}sub preserve {my$self=shift;return 1 if!$self->{"_tempd"};if (@_==0){return$self->{_preserve}=1}else {return$self->{_preserve}=$_[0]? 1 : 0}}sub DESTROY {my ($self)=@_;my$orig=$self->{_original};chdir$orig if$orig;if ($self->{_tempd}&&!$self->{_preserve}){my$err=do {local $@;eval {rmtree($self->{_pushd})};$@};carp$err if$err}}1;
221 FILE_PUSHD
222  
223 2 $fatpacked{"HTTP/Tiny.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'HTTP_TINY';
224 package HTTP::Tiny;use strict;use warnings;our$VERSION='0.056';use Carp ();my@attributes;BEGIN {@attributes=qw(cookie_jar default_headers http_proxy https_proxy keep_alive local_address max_redirect max_size proxy no_proxy timeout SSL_options verify_SSL);my%persist_ok=map {;$_=>1}qw(cookie_jar default_headers max_redirect max_size);no strict 'refs';no warnings 'uninitialized';for my$accessor (@attributes){*{$accessor}=sub {@_ > 1 ? do {delete $_[0]->{handle}if!$persist_ok{$accessor}&& $_[1]ne $_[0]->{$accessor};$_[0]->{$accessor}=$_[1]}: $_[0]->{$accessor}}}}sub agent {my($self,$agent)=@_;if(@_ > 1){$self->{agent}=(defined$agent && $agent =~ / $/)? $agent .$self->_agent : $agent}return$self->{agent}}sub new {my($class,%args)=@_;my$self={max_redirect=>5,timeout=>60,keep_alive=>1,verify_SSL=>$args{verify_SSL}|| $args{verify_ssl}|| 0,no_proxy=>$ENV{no_proxy},};bless$self,$class;$class->_validate_cookie_jar($args{cookie_jar})if$args{cookie_jar};for my$key (@attributes){$self->{$key}=$args{$key}if exists$args{$key}}$self->agent(exists$args{agent}? $args{agent}: $class->_agent);$self->_set_proxies;return$self}sub _set_proxies {my ($self)=@_;if (!exists$self->{proxy}){$self->{proxy}=$ENV{all_proxy}|| $ENV{ALL_PROXY}}if (defined$self->{proxy}){$self->_split_proxy('generic proxy'=>$self->{proxy})}else {delete$self->{proxy}}if (!exists$self->{http_proxy}){local$ENV{HTTP_PROXY}if$ENV{REQUEST_METHOD};$self->{http_proxy}=$ENV{http_proxy}|| $ENV{HTTP_PROXY}|| $self->{proxy}}if (defined$self->{http_proxy}){$self->_split_proxy(http_proxy=>$self->{http_proxy});$self->{_has_proxy}{http}=1}else {delete$self->{http_proxy}}if (!exists$self->{https_proxy}){$self->{https_proxy}=$ENV{https_proxy}|| $ENV{HTTPS_PROXY}|| $self->{proxy}}if ($self->{https_proxy}){$self->_split_proxy(https_proxy=>$self->{https_proxy});$self->{_has_proxy}{https}=1}else {delete$self->{https_proxy}}unless (ref$self->{no_proxy}eq 'ARRAY'){$self->{no_proxy}=(defined$self->{no_proxy})? [split /\s*,\s*/,$self->{no_proxy}]: []}return}for my$sub_name (qw/get head put post delete/){my$req_method=uc$sub_name;no strict 'refs';eval <<"HERE"}sub post_form {my ($self,$url,$data,$args)=@_;(@_==3 || @_==4 && ref$args eq 'HASH')or Carp::croak(q/Usage: $http->post_form(URL, DATAREF, [HASHREF])/ ."\n");my$headers={};while (my ($key,$value)=each %{$args->{headers}|| {}}){$headers->{lc$key}=$value}delete$args->{headers};return$self->request('POST',$url,{%$args,content=>$self->www_form_urlencode($data),headers=>{%$headers,'content-type'=>'application/x-www-form-urlencoded' },})}sub mirror {my ($self,$url,$file,$args)=@_;@_==3 || (@_==4 && ref$args eq 'HASH')or Carp::croak(q/Usage: $http->mirror(URL, FILE, [HASHREF])/ ."\n");if (-e $file and my$mtime=(stat($file))[9]){$args->{headers}{'if-modified-since'}||= $self->_http_date($mtime)}my$tempfile=$file .int(rand(2**31));require Fcntl;sysopen my$fh,$tempfile,Fcntl::O_CREAT()|Fcntl::O_EXCL()|Fcntl::O_WRONLY()or Carp::croak(qq/Error: Could not create temporary file $tempfile for downloading: $!\n/);binmode$fh;$args->{data_callback}=sub {print {$fh}$_[0]};my$response=$self->request('GET',$url,$args);close$fh or Carp::croak(qq/Error: Caught error closing temporary file $tempfile: $!\n/);if ($response->{success}){rename$tempfile,$file or Carp::croak(qq/Error replacing $file with $tempfile: $!\n/);my$lm=$response->{headers}{'last-modified'};if ($lm and my$mtime=$self->_parse_http_date($lm)){utime$mtime,$mtime,$file}}$response->{success}||= $response->{status}eq '304';unlink$tempfile;return$response}my%idempotent=map {$_=>1}qw/GET HEAD PUT DELETE OPTIONS TRACE/;sub request {my ($self,$method,$url,$args)=@_;@_==3 || (@_==4 && ref$args eq 'HASH')or Carp::croak(q/Usage: $http->request(METHOD, URL, [HASHREF])/ ."\n");$args ||= {};my$response;for (0 .. 1){$response=eval {$self->_request($method,$url,$args)};last unless $@ && $idempotent{$method}&& $@ =~ m{^(?:Socket closed|Unexpected end)}}if (my$e=$@){if (ref$e eq 'HASH' && exists$e->{status}){return$e}$e="$e";$response={url=>$url,success=>q{},status=>599,reason=>'Internal Exception',content=>$e,headers=>{'content-type'=>'text/plain','content-length'=>length$e,}}}return$response}sub www_form_urlencode {my ($self,$data)=@_;(@_==2 && ref$data)or Carp::croak(q/Usage: $http->www_form_urlencode(DATAREF)/ ."\n");(ref$data eq 'HASH' || ref$data eq 'ARRAY')or Carp::croak("form data must be a hash or array reference\n");my@params=ref$data eq 'HASH' ? %$data : @$data;@params % 2==0 or Carp::croak("form data reference must have an even number of terms\n");my@terms;while(@params){my ($key,$value)=splice(@params,0,2);if (ref$value eq 'ARRAY'){unshift@params,map {$key=>$_}@$value}else {push@terms,join("=",map {$self->_uri_escape($_)}$key,$value)}}return join("&",(ref$data eq 'ARRAY')? (@terms): (sort@terms))}sub can_ssl {my ($self)=@_;my($ok,$reason)=(1,'');unless (eval {require IO::Socket::SSL;IO::Socket::SSL->VERSION(1.42)}){$ok=0;$reason .= qq/IO::Socket::SSL 1.42 must be installed for https support\n/}unless (eval {require Net::SSLeay;Net::SSLeay->VERSION(1.49)}){$ok=0;$reason .= qq/Net::SSLeay 1.49 must be installed for https support\n/}if (ref($self)&& ($self->{verify_SSL}|| $self->{SSL_options}{SSL_verify_mode})){my$handle=HTTP::Tiny::Handle->new(SSL_options=>$self->{SSL_options},verify_SSL=>$self->{verify_SSL},);unless (eval {$handle->_find_CA_file;1}){$ok=0;$reason .= "$@"}}wantarray ? ($ok,$reason): $ok}my%DefaultPort=(http=>80,https=>443,);sub _agent {my$class=ref($_[0])|| $_[0];(my$default_agent=$class)=~ s{::}{-}g;return$default_agent ."/" .$class->VERSION}sub _request {my ($self,$method,$url,$args)=@_;my ($scheme,$host,$port,$path_query,$auth)=$self->_split_url($url);my$request={method=>$method,scheme=>$scheme,host=>$host,port=>$port,host_port=>($port==$DefaultPort{$scheme}? $host : "$host:$port"),uri=>$path_query,headers=>{},};my$handle=delete$self->{handle};if ($handle){unless ($handle->can_reuse($scheme,$host,$port)){$handle->close;undef$handle}}$handle ||= $self->_open_handle($request,$scheme,$host,$port);$self->_prepare_headers_and_cb($request,$args,$url,$auth);$handle->write_request($request);my$response;do {$response=$handle->read_response_header}until (substr($response->{status},0,1)ne '1');$self->_update_cookie_jar($url,$response)if$self->{cookie_jar};if (my@redir_args=$self->_maybe_redirect($request,$response,$args)){$handle->close;return$self->_request(@redir_args,$args)}my$known_message_length;if ($method eq 'HEAD' || $response->{status}=~ /^[23]04/){$known_message_length=1}else {my$data_cb=$self->_prepare_data_cb($response,$args);$known_message_length=$handle->read_body($data_cb,$response)}if ($self->{keep_alive}&& $known_message_length && $response->{protocol}eq 'HTTP/1.1' && ($response->{headers}{connection}|| '')ne 'close'){$self->{handle}=$handle}else {$handle->close}$response->{success}=substr($response->{status},0,1)eq '2';$response->{url}=$url;return$response}sub _open_handle {my ($self,$request,$scheme,$host,$port)=@_;my$handle=HTTP::Tiny::Handle->new(timeout=>$self->{timeout},SSL_options=>$self->{SSL_options},verify_SSL=>$self->{verify_SSL},local_address=>$self->{local_address},keep_alive=>$self->{keep_alive});if ($self->{_has_proxy}{$scheme}&&!grep {$host =~ /\Q$_\E$/}@{$self->{no_proxy}}){return$self->_proxy_connect($request,$handle)}else {return$handle->connect($scheme,$host,$port)}}sub _proxy_connect {my ($self,$request,$handle)=@_;my@proxy_vars;if ($request->{scheme}eq 'https'){Carp::croak(qq{No https_proxy defined})unless$self->{https_proxy};@proxy_vars=$self->_split_proxy(https_proxy=>$self->{https_proxy});if ($proxy_vars[0]eq 'https'){Carp::croak(qq{Can't proxy https over https: $request->{uri} via $self->{https_proxy}})}}else {Carp::croak(qq{No http_proxy defined})unless$self->{http_proxy};@proxy_vars=$self->_split_proxy(http_proxy=>$self->{http_proxy})}my ($p_scheme,$p_host,$p_port,$p_auth)=@proxy_vars;if (length$p_auth &&!defined$request->{headers}{'proxy-authorization'}){$self->_add_basic_auth_header($request,'proxy-authorization'=>$p_auth)}$handle->connect($p_scheme,$p_host,$p_port);if ($request->{scheme}eq 'https'){$self->_create_proxy_tunnel($request,$handle)}else {$request->{uri}="$request->{scheme}://$request->{host_port}$request->{uri}"}return$handle}sub _split_proxy {my ($self,$type,$proxy)=@_;my ($scheme,$host,$port,$path_query,$auth)=eval {$self->_split_url($proxy)};unless(defined($scheme)&& length($scheme)&& length($host)&& length($port)&& $path_query eq '/'){Carp::croak(qq{$type URL must be in format http[s]://[auth@]<host>:<port>/\n})}return ($scheme,$host,$port,$auth)}sub _create_proxy_tunnel {my ($self,$request,$handle)=@_;$handle->_assert_ssl;my$agent=exists($request->{headers}{'user-agent'})? $request->{headers}{'user-agent'}: $self->{agent};my$connect_request={method=>'CONNECT',uri=>"$request->{host}:$request->{port}",headers=>{host=>"$request->{host}:$request->{port}",'user-agent'=>$agent,}};if ($request->{headers}{'proxy-authorization'}){$connect_request->{headers}{'proxy-authorization'}=delete$request->{headers}{'proxy-authorization'}}$handle->write_request($connect_request);my$response;do {$response=$handle->read_response_header}until (substr($response->{status},0,1)ne '1');unless (substr($response->{status},0,1)eq '2'){die$response}$handle->start_ssl($request->{host});return}sub _prepare_headers_and_cb {my ($self,$request,$args,$url,$auth)=@_;for ($self->{default_headers},$args->{headers}){next unless defined;while (my ($k,$v)=each %$_){$request->{headers}{lc$k}=$v}}if (exists$request->{headers}{'host'}){die(qq/The 'Host' header must not be provided as header option\n/)}$request->{headers}{'host'}=$request->{host_port};$request->{headers}{'user-agent'}||= $self->{agent};$request->{headers}{'connection'}="close" unless$self->{keep_alive};if (defined$args->{content}){if (ref$args->{content}eq 'CODE'){$request->{headers}{'content-type'}||= "application/octet-stream";$request->{headers}{'transfer-encoding'}='chunked' unless$request->{headers}{'content-length'}|| $request->{headers}{'transfer-encoding'};$request->{cb}=$args->{content}}elsif (length$args->{content}){my$content=$args->{content};if ($] ge '5.008'){utf8::downgrade($content,1)or die(qq/Wide character in request message body\n/)}$request->{headers}{'content-type'}||= "application/octet-stream";$request->{headers}{'content-length'}=length$content unless$request->{headers}{'content-length'}|| $request->{headers}{'transfer-encoding'};$request->{cb}=sub {substr$content,0,length$content,''}}$request->{trailer_cb}=$args->{trailer_callback}if ref$args->{trailer_callback}eq 'CODE'}if ($self->{cookie_jar}){my$cookies=$self->cookie_jar->cookie_header($url);$request->{headers}{cookie}=$cookies if length$cookies}if (length$auth &&!defined$request->{headers}{authorization}){$self->_add_basic_auth_header($request,'authorization'=>$auth)}return}sub _add_basic_auth_header {my ($self,$request,$header,$auth)=@_;require MIME::Base64;$request->{headers}{$header}="Basic " .MIME::Base64::encode_base64($auth,"");return}sub _prepare_data_cb {my ($self,$response,$args)=@_;my$data_cb=$args->{data_callback};$response->{content}='';if (!$data_cb || $response->{status}!~ /^2/){if (defined$self->{max_size}){$data_cb=sub {$_[1]->{content}.= $_[0];die(qq/Size of response body exceeds the maximum allowed of $self->{max_size}\n/)if length $_[1]->{content}> $self->{max_size}}}else {$data_cb=sub {$_[1]->{content}.= $_[0]}}}return$data_cb}sub _update_cookie_jar {my ($self,$url,$response)=@_;my$cookies=$response->{headers}->{'set-cookie'};return unless defined$cookies;my@cookies=ref$cookies ? @$cookies : $cookies;$self->cookie_jar->add($url,$_)for@cookies;return}sub _validate_cookie_jar {my ($class,$jar)=@_;for my$method (qw/add cookie_header/){Carp::croak(qq/Cookie jar must provide the '$method' method\n/)unless ref($jar)&& ref($jar)->can($method)}return}sub _maybe_redirect {my ($self,$request,$response,$args)=@_;my$headers=$response->{headers};my ($status,$method)=($response->{status},$request->{method});if (($status eq '303' or ($status =~ /^30[1278]/ && $method =~ /^GET|HEAD$/))and $headers->{location}and ++$args->{redirects}<= $self->{max_redirect}){my$location=($headers->{location}=~ /^\//)? "$request->{scheme}://$request->{host_port}$headers->{location}" : $headers->{location};return (($status eq '303' ? 'GET' : $method),$location)}return}sub _split_url {my$url=pop;my ($scheme,$host,$path_query)=$url =~ m<\A([^:/?#]+)://([^/?#]*)([^#]*)> or die(qq/Cannot parse URL: '$url'\n/);$scheme=lc$scheme;$path_query="/$path_query" unless$path_query =~ m<\A/>;my$auth='';if ((my$i=index$host,'@')!=-1){$auth=substr$host,0,$i,'';substr$host,0,1,'';$auth =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg}my$port=$host =~ s/:(\d*)\z// && length $1 ? $1 : $scheme eq 'http' ? 80 : $scheme eq 'https' ? 443 : undef;return ($scheme,(length$host ? lc$host : "localhost"),$port,$path_query,$auth)}my$DoW="Sun|Mon|Tue|Wed|Thu|Fri|Sat";my$MoY="Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec";sub _http_date {my ($sec,$min,$hour,$mday,$mon,$year,$wday)=gmtime($_[1]);return sprintf("%s, %02d %s %04d %02d:%02d:%02d GMT",substr($DoW,$wday*4,3),$mday,substr($MoY,$mon*4,3),$year+1900,$hour,$min,$sec)}sub _parse_http_date {my ($self,$str)=@_;require Time::Local;my@tl_parts;if ($str =~ /^[SMTWF][a-z]+, +(\d{1,2}) ($MoY) +(\d\d\d\d) +(\d\d):(\d\d):(\d\d) +GMT$/){@tl_parts=($6,$5,$4,$1,(index($MoY,$2)/4),$3)}elsif ($str =~ /^[SMTWF][a-z]+, +(\d\d)-($MoY)-(\d{2,4}) +(\d\d):(\d\d):(\d\d) +GMT$/){@tl_parts=($6,$5,$4,$1,(index($MoY,$2)/4),$3)}elsif ($str =~ /^[SMTWF][a-z]+ +($MoY) +(\d{1,2}) +(\d\d):(\d\d):(\d\d) +(?:[^0-9]+ +)?(\d\d\d\d)$/){@tl_parts=($5,$4,$3,$2,(index($MoY,$1)/4),$6)}return eval {my$t=@tl_parts ? Time::Local::timegm(@tl_parts): -1;$t < 0 ? undef : $t}}my%escapes=map {chr($_)=>sprintf("%%%02X",$_)}0..255;$escapes{' '}="+";my$unsafe_char=qr/[^A-Za-z0-9\-\._~]/;sub _uri_escape {my ($self,$str)=@_;if ($] ge '5.008'){utf8::encode($str)}else {$str=pack("U*",unpack("C*",$str))if (length$str==do {use bytes;length$str});$str=pack("C*",unpack("C*",$str))}$str =~ s/($unsafe_char)/$escapes{$1}/ge;return$str}package HTTP::Tiny::Handle;use strict;use warnings;use Errno qw[EINTR EPIPE];use IO::Socket qw[SOCK_STREAM];my$SOCKET_CLASS=$ENV{PERL_HTTP_TINY_IPV4_ONLY}? 'IO::Socket::INET' : eval {require IO::Socket::IP;IO::Socket::IP->VERSION(0.25)}? 'IO::Socket::IP' : 'IO::Socket::INET';sub BUFSIZE () {32768}my$Printable=sub {local $_=shift;s/\r/\\r/g;s/\n/\\n/g;s/\t/\\t/g;s/([^\x20-\x7E])/sprintf('\\x%.2X', ord($1))/ge;$_};my$Token=qr/[\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5A\x5E-\x7A\x7C\x7E]/;sub new {my ($class,%args)=@_;return bless {rbuf=>'',timeout=>60,max_line_size=>16384,max_header_lines=>64,verify_SSL=>0,SSL_options=>{},%args },$class}sub connect {@_==4 || die(q/Usage: $handle->connect(scheme, host, port)/ ."\n");my ($self,$scheme,$host,$port)=@_;if ($scheme eq 'https'){$self->_assert_ssl}elsif ($scheme ne 'http'){die(qq/Unsupported URL scheme '$scheme'\n/)}$self->{fh}=$SOCKET_CLASS->new(PeerHost=>$host,PeerPort=>$port,$self->{local_address}? (LocalAddr=>$self->{local_address}): (),Proto=>'tcp',Type=>SOCK_STREAM,Timeout=>$self->{timeout},KeepAlive=>!!$self->{keep_alive})or die(qq/Could not connect to '$host:$port': $@\n/);binmode($self->{fh})or die(qq/Could not binmode() socket: '$!'\n/);$self->start_ssl($host)if$scheme eq 'https';$self->{scheme}=$scheme;$self->{host}=$host;$self->{port}=$port;$self->{pid}=$$;$self->{tid}=_get_tid();return$self}sub start_ssl {my ($self,$host)=@_;if (ref($self->{fh})eq 'IO::Socket::SSL'){unless ($self->{fh}->stop_SSL){my$ssl_err=IO::Socket::SSL->errstr;die(qq/Error halting prior SSL connection: $ssl_err/)}}my$ssl_args=$self->_ssl_args($host);IO::Socket::SSL->start_SSL($self->{fh},%$ssl_args,SSL_create_ctx_callback=>sub {my$ctx=shift;Net::SSLeay::CTX_set_mode($ctx,Net::SSLeay::MODE_AUTO_RETRY())},);unless (ref($self->{fh})eq 'IO::Socket::SSL'){my$ssl_err=IO::Socket::SSL->errstr;die(qq/SSL connection failed for $host: $ssl_err\n/)}}sub close {@_==1 || die(q/Usage: $handle->close()/ ."\n");my ($self)=@_;CORE::close($self->{fh})or die(qq/Could not close socket: '$!'\n/)}sub write {@_==2 || die(q/Usage: $handle->write(buf)/ ."\n");my ($self,$buf)=@_;if ($] ge '5.008'){utf8::downgrade($buf,1)or die(qq/Wide character in write()\n/)}my$len=length$buf;my$off=0;local$SIG{PIPE}='IGNORE';while (){$self->can_write or die(qq/Timed out while waiting for socket to become ready for writing\n/);my$r=syswrite($self->{fh},$buf,$len,$off);if (defined$r){$len -= $r;$off += $r;last unless$len > 0}elsif ($!==EPIPE){die(qq/Socket closed by remote server: $!\n/)}elsif ($!!=EINTR){if ($self->{fh}->can('errstr')){my$err=$self->{fh}->errstr();die (qq/Could not write to SSL socket: '$err'\n /)}else {die(qq/Could not write to socket: '$!'\n/)}}}return$off}sub read {@_==2 || @_==3 || die(q/Usage: $handle->read(len [, allow_partial])/ ."\n");my ($self,$len,$allow_partial)=@_;my$buf='';my$got=length$self->{rbuf};if ($got){my$take=($got < $len)? $got : $len;$buf=substr($self->{rbuf},0,$take,'');$len -= $take}while ($len > 0){$self->can_read or die(q/Timed out while waiting for socket to become ready for reading/ ."\n");my$r=sysread($self->{fh},$buf,$len,length$buf);if (defined$r){last unless$r;$len -= $r}elsif ($!!=EINTR){if ($self->{fh}->can('errstr')){my$err=$self->{fh}->errstr();die (qq/Could not read from SSL socket: '$err'\n /)}else {die(qq/Could not read from socket: '$!'\n/)}}}if ($len &&!$allow_partial){die(qq/Unexpected end of stream\n/)}return$buf}sub readline {@_==1 || die(q/Usage: $handle->readline()/ ."\n");my ($self)=@_;while (){if ($self->{rbuf}=~ s/\A ([^\x0D\x0A]* \x0D?\x0A)//x){return $1}if (length$self->{rbuf}>= $self->{max_line_size}){die(qq/Line size exceeds the maximum allowed size of $self->{max_line_size}\n/)}$self->can_read or die(qq/Timed out while waiting for socket to become ready for reading\n/);my$r=sysread($self->{fh},$self->{rbuf},BUFSIZE,length$self->{rbuf});if (defined$r){last unless$r}elsif ($!!=EINTR){if ($self->{fh}->can('errstr')){my$err=$self->{fh}->errstr();die (qq/Could not read from SSL socket: '$err'\n /)}else {die(qq/Could not read from socket: '$!'\n/)}}}die(qq/Unexpected end of stream while looking for line\n/)}sub read_header_lines {@_==1 || @_==2 || die(q/Usage: $handle->read_header_lines([headers])/ ."\n");my ($self,$headers)=@_;$headers ||= {};my$lines=0;my$val;while (){my$line=$self->readline;if (++$lines >= $self->{max_header_lines}){die(qq/Header lines exceeds maximum number allowed of $self->{max_header_lines}\n/)}elsif ($line =~ /\A ([^\x00-\x1F\x7F:]+) : [\x09\x20]* ([^\x0D\x0A]*)/x){my ($field_name)=lc $1;if (exists$headers->{$field_name}){for ($headers->{$field_name}){$_=[$_]unless ref $_ eq "ARRAY";push @$_,$2;$val=\$_->[-1]}}else {$val=\($headers->{$field_name}=$2)}}elsif ($line =~ /\A [\x09\x20]+ ([^\x0D\x0A]*)/x){$val or die(qq/Unexpected header continuation line\n/);next unless length $1;$$val .= ' ' if length $$val;$$val .= $1}elsif ($line =~ /\A \x0D?\x0A \z/x){last}else {die(q/Malformed header line: / .$Printable->($line)."\n")}}return$headers}sub write_request {@_==2 || die(q/Usage: $handle->write_request(request)/ ."\n");my($self,$request)=@_;$self->write_request_header(@{$request}{qw/method uri headers/});$self->write_body($request)if$request->{cb};return}my%HeaderCase=('content-md5'=>'Content-MD5','etag'=>'ETag','te'=>'TE','www-authenticate'=>'WWW-Authenticate','x-xss-protection'=>'X-XSS-Protection',);sub write_header_lines {(@_==2 || @_==3 && ref $_[1]eq 'HASH')|| die(q/Usage: $handle->write_header_lines(headers[,prefix])/ ."\n");my($self,$headers,$prefix_data)=@_;my$buf=(defined$prefix_data ? $prefix_data : '');while (my ($k,$v)=each %$headers){my$field_name=lc$k;if (exists$HeaderCase{$field_name}){$field_name=$HeaderCase{$field_name}}else {$field_name =~ /\A $Token+ \z/xo or die(q/Invalid HTTP header field name: / .$Printable->($field_name)."\n");$field_name =~ s/\b(\w)/\u$1/g;$HeaderCase{lc$field_name}=$field_name}for (ref$v eq 'ARRAY' ? @$v : $v){$_='' unless defined $_;$buf .= "$field_name: $_\x0D\x0A"}}$buf .= "\x0D\x0A";return$self->write($buf)}sub read_body {@_==3 || die(q/Usage: $handle->read_body(callback, response)/ ."\n");my ($self,$cb,$response)=@_;my$te=$response->{headers}{'transfer-encoding'}|| '';my$chunked=grep {/chunked/i}(ref$te eq 'ARRAY' ? @$te : $te);return$chunked ? $self->read_chunked_body($cb,$response): $self->read_content_body($cb,$response)}sub write_body {@_==2 || die(q/Usage: $handle->write_body(request)/ ."\n");my ($self,$request)=@_;if ($request->{headers}{'content-length'}){return$self->write_content_body($request)}else {return$self->write_chunked_body($request)}}sub read_content_body {@_==3 || @_==4 || die(q/Usage: $handle->read_content_body(callback, response, [read_length])/ ."\n");my ($self,$cb,$response,$content_length)=@_;$content_length ||= $response->{headers}{'content-length'};if (defined$content_length){my$len=$content_length;while ($len > 0){my$read=($len > BUFSIZE)? BUFSIZE : $len;$cb->($self->read($read,0),$response);$len -= $read}return length($self->{rbuf})==0}my$chunk;$cb->($chunk,$response)while length($chunk=$self->read(BUFSIZE,1));return}sub write_content_body {@_==2 || die(q/Usage: $handle->write_content_body(request)/ ."\n");my ($self,$request)=@_;my ($len,$content_length)=(0,$request->{headers}{'content-length'});while (){my$data=$request->{cb}->();defined$data && length$data or last;if ($] ge '5.008'){utf8::downgrade($data,1)or die(qq/Wide character in write_content()\n/)}$len += $self->write($data)}$len==$content_length or die(qq/Content-Length mismatch (got: $len expected: $content_length)\n/);return$len}sub read_chunked_body {@_==3 || die(q/Usage: $handle->read_chunked_body(callback, $response)/ ."\n");my ($self,$cb,$response)=@_;while (){my$head=$self->readline;$head =~ /\A ([A-Fa-f0-9]+)/x or die(q/Malformed chunk head: / .$Printable->($head)."\n");my$len=hex($1)or last;$self->read_content_body($cb,$response,$len);$self->read(2)eq "\x0D\x0A" or die(qq/Malformed chunk: missing CRLF after chunk data\n/)}$self->read_header_lines($response->{headers});return 1}sub write_chunked_body {@_==2 || die(q/Usage: $handle->write_chunked_body(request)/ ."\n");my ($self,$request)=@_;my$len=0;while (){my$data=$request->{cb}->();defined$data && length$data or last;if ($] ge '5.008'){utf8::downgrade($data,1)or die(qq/Wide character in write_chunked_body()\n/)}$len += length$data;my$chunk=sprintf '%X',length$data;$chunk .= "\x0D\x0A";$chunk .= $data;$chunk .= "\x0D\x0A";$self->write($chunk)}$self->write("0\x0D\x0A");$self->write_header_lines($request->{trailer_cb}->())if ref$request->{trailer_cb}eq 'CODE';return$len}sub read_response_header {@_==1 || die(q/Usage: $handle->read_response_header()/ ."\n");my ($self)=@_;my$line=$self->readline;$line =~ /\A (HTTP\/(0*\d+\.0*\d+)) [\x09\x20]+ ([0-9]{3}) [\x09\x20]+ ([^\x0D\x0A]*) \x0D?\x0A/x or die(q/Malformed Status-Line: / .$Printable->($line)."\n");my ($protocol,$version,$status,$reason)=($1,$2,$3,$4);die (qq/Unsupported HTTP protocol: $protocol\n/)unless$version =~ /0*1\.0*[01]/;return {status=>$status,reason=>$reason,headers=>$self->read_header_lines,protocol=>$protocol,}}sub write_request_header {@_==4 || die(q/Usage: $handle->write_request_header(method, request_uri, headers)/ ."\n");my ($self,$method,$request_uri,$headers)=@_;return$self->write_header_lines($headers,"$method $request_uri HTTP/1.1\x0D\x0A")}sub _do_timeout {my ($self,$type,$timeout)=@_;$timeout=$self->{timeout}unless defined$timeout && $timeout >= 0;my$fd=fileno$self->{fh};defined$fd && $fd >= 0 or die(qq/select(2): 'Bad file descriptor'\n/);my$initial=time;my$pending=$timeout;my$nfound;vec(my$fdset='',$fd,1)=1;while (){$nfound=($type eq 'read')? select($fdset,undef,undef,$pending): select(undef,$fdset,undef,$pending);if ($nfound==-1){$!==EINTR or die(qq/select(2): '$!'\n/);redo if!$timeout || ($pending=$timeout - (time - $initial))> 0;$nfound=0}last}$!=0;return$nfound}sub can_read {@_==1 || @_==2 || die(q/Usage: $handle->can_read([timeout])/ ."\n");my$self=shift;if (ref($self->{fh})eq 'IO::Socket::SSL'){return 1 if$self->{fh}->pending}return$self->_do_timeout('read',@_)}sub can_write {@_==1 || @_==2 || die(q/Usage: $handle->can_write([timeout])/ ."\n");my$self=shift;return$self->_do_timeout('write',@_)}sub _assert_ssl {my($ok,$reason)=HTTP::Tiny->can_ssl();die$reason unless$ok}sub can_reuse {my ($self,$scheme,$host,$port)=@_;return 0 if$self->{pid}!=$$ || $self->{tid}!=_get_tid()|| length($self->{rbuf})|| $scheme ne $self->{scheme}|| $host ne $self->{host}|| $port ne $self->{port}|| eval {$self->can_read(0)}|| $@ ;return 1}sub _find_CA_file {my$self=shift();if ($self->{SSL_options}->{SSL_ca_file}){unless (-r $self->{SSL_options}->{SSL_ca_file}){die qq/SSL_ca_file '$self->{SSL_options}->{SSL_ca_file}' not found or not readable\n/}return$self->{SSL_options}->{SSL_ca_file}}return Mozilla::CA::SSL_ca_file()if eval {require Mozilla::CA;1};for my$ca_bundle ("/etc/ssl/certs/ca-certificates.crt","/etc/pki/tls/certs/ca-bundle.crt","/etc/ssl/ca-bundle.pem","/etc/openssl/certs/ca-certificates.crt","/etc/ssl/cert.pem","/usr/local/share/certs/ca-root-nss.crt","/etc/pki/tls/cacert.pem","/etc/certs/ca-certificates.crt",){return$ca_bundle if -e $ca_bundle}die qq/Couldn't find a CA bundle with which to verify the SSL certificate.\n/ .qq/Try installing Mozilla::CA from CPAN\n/}sub _get_tid {no warnings 'reserved';return threads->can("tid")? threads->tid : 0}sub _ssl_args {my ($self,$host)=@_;my%ssl_args;if (Net::SSLeay::OPENSSL_VERSION_NUMBER()>= 0x01000000){$ssl_args{SSL_hostname}=$host,}if ($self->{verify_SSL}){$ssl_args{SSL_verifycn_scheme}='http';$ssl_args{SSL_verifycn_name}=$host;$ssl_args{SSL_verify_mode}=0x01;$ssl_args{SSL_ca_file}=$self->_find_CA_file}else {$ssl_args{SSL_verifycn_scheme}='none';$ssl_args{SSL_verify_mode}=0x00}for my$k (keys %{$self->{SSL_options}}){$ssl_args{$k}=$self->{SSL_options}{$k}if$k =~ m/^SSL_/}return \%ssl_args}1;
225 sub $sub_name {
226 my (\$self, \$url, \$args) = \@_;
227 \@_ == 2 || (\@_ == 3 && ref \$args eq 'HASH')
228 or Carp::croak(q/Usage: \$http->$sub_name(URL, [HASHREF])/ . "\n");
229 return \$self->request('$req_method', \$url, \$args || {});
230 }
231 HERE
232 HTTP_TINY
233  
234 2 $fatpacked{"JSON/PP.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'JSON_PP';
235 0 ▶ package JSON::PP;use 5.005;use strict;use base qw(Exporter);use overload ();use Carp ();use B ();$JSON::PP::VERSION='2.27300';@JSON::PP::EXPORT=qw(encode_json decode_json from_json to_json);use constant P_ASCII=>0;use constant P_LATIN1=>1;use constant P_UTF8=>2;use constant P_INDENT=>3;use constant P_CANONICAL=>4;use constant P_SPACE_BEFORE=>5;use constant P_SPACE_AFTER=>6;use constant P_ALLOW_NONREF=>7;use constant P_SHRINK=>8;use constant P_ALLOW_BLESSED=>9;use constant P_CONVERT_BLESSED=>10;use constant P_RELAXED=>11;use constant P_LOOSE=>12;use constant P_ALLOW_BIGNUM=>13;use constant P_ALLOW_BAREKEY=>14;use constant P_ALLOW_SINGLEQUOTE=>15;use constant P_ESCAPE_SLASH=>16;use constant P_AS_NONBLESSED=>17;use constant P_ALLOW_UNKNOWN=>18;use constant OLD_PERL=>$] < 5.008 ? 1 : 0;BEGIN {my@xs_compati_bit_properties=qw(latin1 ascii utf8 indent canonical space_before space_after allow_nonref shrink allow_blessed convert_blessed relaxed allow_unknown);my@pp_bit_properties=qw(allow_singlequote allow_bignum loose allow_barekey escape_slash as_nonblessed);if ($] < 5.008){my$helper=$] >= 5.006 ? 'JSON::PP::Compat5006' : 'JSON::PP::Compat5005';eval qq| require $helper |;if ($@){Carp::croak $@}}for my$name (@xs_compati_bit_properties,@pp_bit_properties){my$flag_name='P_' .uc($name);eval qq/
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=1 SCAR=2.7
Subroutine BEGIN: called CC=2 SCAR=11.8
Subroutine BEGIN: called CC=5 SCAR=25.5
Subroutine allow_barekey: not called CC=3 SCAR=17.6
Subroutine allow_bignum: not called CC=3 SCAR=17.6
Subroutine allow_blessed: called CC=3 SCAR=17.6
Subroutine allow_nonref: not called CC=3 SCAR=17.6
Subroutine allow_singlequote: not called CC=3 SCAR=17.6
Subroutine allow_unknown: not called CC=3 SCAR=17.6
Subroutine as_nonblessed: not called CC=3 SCAR=17.6
Subroutine ascii: not called CC=3 SCAR=17.6
Subroutine canonical: not called CC=3 SCAR=17.6
Subroutine convert_blessed: called CC=3 SCAR=17.6
Subroutine escape_slash: not called CC=3 SCAR=17.6
Subroutine get_allow_barekey: not called CC=2 SCAR=11.8
Subroutine get_allow_bignum: not called CC=2 SCAR=11.8
Subroutine get_allow_blessed: not called CC=2 SCAR=11.8
Subroutine get_allow_nonref: not called CC=2 SCAR=11.8
Subroutine get_allow_singlequote: not called CC=2 SCAR=11.8
Subroutine get_allow_unknown: not called CC=2 SCAR=11.8
Subroutine get_as_nonblessed: not called CC=2 SCAR=11.8
Subroutine get_ascii: not called CC=2 SCAR=11.8
Subroutine get_canonical: not called CC=2 SCAR=11.8
Subroutine get_convert_blessed: not called CC=2 SCAR=11.8
Subroutine get_escape_slash: not called CC=2 SCAR=11.8
Subroutine get_indent: not called CC=2 SCAR=11.8
Subroutine get_latin1: not called CC=2 SCAR=11.8
Subroutine get_loose: not called CC=2 SCAR=11.8
Subroutine get_relaxed: not called CC=2 SCAR=11.8
Subroutine get_shrink: not called CC=2 SCAR=11.8
Subroutine get_space_after: not called CC=2 SCAR=11.8
Subroutine get_space_before: not called CC=2 SCAR=11.8
Subroutine get_utf8: not called CC=2 SCAR=11.8
Subroutine indent: not called CC=3 SCAR=17.6
Subroutine latin1: not called CC=3 SCAR=17.6
Subroutine loose: not called CC=3 SCAR=17.6
Subroutine relaxed: not called CC=3 SCAR=17.6
Subroutine shrink: not called CC=3 SCAR=17.6
Subroutine space_after: not called CC=3 SCAR=17.6
Subroutine space_before: not called CC=3 SCAR=17.6
Subroutine utf8: called CC=3 SCAR=17.6
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod undocumented
Pod documented
Pod documented
Pod documented
Pod documented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Branch: 61 branches
BranchTrueFalseTotal
$] < 5.008 ? : 0 2 2
if ($] < "5.008") 0 2 2
$] >= 5.006 ? : 0 0 0
if ($@) 0 0 0
defined $_[1] ? : 0 0 0
if ($enable) { } 0 0 0
defined $_[1] ? : 0 0 0
if ($enable) { } 0 0 0
defined $_[1] ? : 0 4 4
if ($enable) { } 4 0 4
defined $_[1] ? : 0 0 0
if ($enable) { } 0 0 0
defined $_[1] ? : 0 0 0
if ($enable) { } 0 0 0
defined $_[1] ? : 0 0 0
if ($enable) { } 0 0 0
defined $_[1] ? : 0 0 0
if ($enable) { } 0 0 0
defined $_[1] ? : 0 0 0
if ($enable) { } 0 0 0
defined $_[1] ? : 0 0 0
if ($enable) { } 0 0 0
defined $_[1] ? : 0 4 4
if ($enable) { } 4 0 4
defined $_[1] ? : 0 0 0
if ($enable) { } 0 0 0
$_[0]{'PROPS'}[14] ? : 0 0 0
$_[0]{'PROPS'}[13] ? : 0 0 0
$_[0]{'PROPS'}[9] ? : 0 0 0
$_[0]{'PROPS'}[7] ? : 0 0 0
$_[0]{'PROPS'}[15] ? : 0 0 0
$_[0]{'PROPS'}[18] ? : 0 0 0
$_[0]{'PROPS'}[17] ? : 0 0 0
$_[0]{'PROPS'}[0] ? : 0 0 0
$_[0]{'PROPS'}[4] ? : 0 0 0
$_[0]{'PROPS'}[10] ? : 0 0 0
$_[0]{'PROPS'}[16] ? : 0 0 0
$_[0]{'PROPS'}[3] ? : 0 0 0
$_[0]{'PROPS'}[1] ? : 0 0 0
$_[0]{'PROPS'}[12] ? : 0 0 0
$_[0]{'PROPS'}[11] ? : 0 0 0
$_[0]{'PROPS'}[8] ? : 0 0 0
$_[0]{'PROPS'}[6] ? : 0 0 0
$_[0]{'PROPS'}[5] ? : 0 0 0
$_[0]{'PROPS'}[2] ? : 0 0 0
defined $_[1] ? : 0 0 0
if ($enable) { } 0 0 0
defined $_[1] ? : 0 0 0
if ($enable) { } 0 0 0
defined $_[1] ? : 0 0 0
if ($enable) { } 0 0 0
defined $_[1] ? : 0 0 0
if ($enable) { } 0 0 0
defined $_[1] ? : 0 0 0
if ($enable) { } 0 0 0
defined $_[1] ? : 0 0 0
if ($enable) { } 0 0 0
defined $_[1] ? : 0 0 0
if ($enable) { } 0 0 0
defined $_[1] ? : 0 4 4
if ($enable) { } 4 0 4
236 sub $name {
237 my \$enable = defined \$_[1] ? \$_[1] : 1;
238
239 if (\$enable) {
240 \$_[0]->{PROPS}->[$flag_name] = 1;
241 }
242 else {
243 \$_[0]->{PROPS}->[$flag_name] = 0;
244 }
245
246 \$_[0];
247 }
248
249 sub get_$name {
250 \$_[0]->{PROPS}->[$flag_name] ? 1 : '';
251 }
252 0 ▶ /}}my%encode_allow_method=map {($_=>1)}qw/utf8 pretty allow_nonref latin1 self_encode escape_slash allow_blessed convert_blessed indent indent_length allow_bignum as_nonblessed/;my%decode_allow_method=map {($_=>1)}qw/utf8 allow_nonref loose allow_singlequote allow_bignum allow_barekey max_size relaxed/;my$JSON;sub encode_json ($) {($JSON ||= __PACKAGE__->new->utf8)->encode(@_)}sub decode_json {($JSON ||= __PACKAGE__->new->utf8)->decode(@_)}sub to_json($) {Carp::croak ("JSON::PP::to_json has been renamed to encode_json.")}sub from_json($) {Carp::croak ("JSON::PP::from_json has been renamed to decode_json.")}sub new {my$class=shift;my$self={max_depth=>512,max_size=>0,indent=>0,FLAGS=>0,fallback=>sub {encode_error('Invalid value. JSON can only reference.')},indent_length=>3,};bless$self,$class}sub encode {return $_[0]->PP_encode_json($_[1])}sub decode {return $_[0]->PP_decode_json($_[1],0x00000000)}sub decode_prefix {return $_[0]->PP_decode_json($_[1],0x00000001)}sub pretty {my ($self,$v)=@_;my$enable=defined$v ? $v : 1;if ($enable){$self->indent(1)->indent_length(3)->space_before(1)->space_after(1)}else {$self->indent(0)->space_before(0)->space_after(0)}$self}sub max_depth {my$max=defined $_[1]? $_[1]: 0x80000000;$_[0]->{max_depth}=$max;$_[0]}sub get_max_depth {$_[0]->{max_depth}}sub max_size {my$max=defined $_[1]? $_[1]: 0;$_[0]->{max_size}=$max;$_[0]}sub get_max_size {$_[0]->{max_size}}sub filter_json_object {$_[0]->{cb_object}=defined $_[1]? $_[1]: 0;$_[0]->{F_HOOK}=($_[0]->{cb_object}or $_[0]->{cb_sk_object})? 1 : 0;$_[0]}sub filter_json_single_key_object {if (@_ > 1){$_[0]->{cb_sk_object}->{$_[1]}=$_[2]}$_[0]->{F_HOOK}=($_[0]->{cb_object}or $_[0]->{cb_sk_object})? 1 : 0;$_[0]}sub indent_length {if (!defined $_[1]or $_[1]> 15 or $_[1]< 0){Carp::carp "The acceptable range of indent_length() is 0 to 15."}else {$_[0]->{indent_length}=$_[1]}$_[0]}sub get_indent_length {$_[0]->{indent_length}}sub sort_by {$_[0]->{sort_by}=defined $_[1]? $_[1]: 1;$_[0]}sub allow_bigint {Carp::carp("allow_bigint() is obsoleted. use allow_bignum() insted.")}{my$max_depth;my$indent;my$ascii;my$latin1;my$utf8;my$space_before;my$space_after;my$canonical;my$allow_blessed;my$convert_blessed;my$indent_length;my$escape_slash;my$bignum;my$as_nonblessed;my$depth;my$indent_count;my$keysort;sub PP_encode_json {my$self=shift;my$obj=shift;$indent_count=0;$depth=0;my$idx=$self->{PROPS};($ascii,$latin1,$utf8,$indent,$canonical,$space_before,$space_after,$allow_blessed,$convert_blessed,$escape_slash,$bignum,$as_nonblessed)=@{$idx}[P_ASCII .. P_SPACE_AFTER,P_ALLOW_BLESSED,P_CONVERT_BLESSED,P_ESCAPE_SLASH,P_ALLOW_BIGNUM,P_AS_NONBLESSED];($max_depth,$indent_length)=@{$self}{qw/max_depth indent_length/};$keysort=$canonical ? sub {$a cmp $b}: undef;if ($self->{sort_by}){$keysort=ref($self->{sort_by})eq 'CODE' ? $self->{sort_by}: $self->{sort_by}=~ /\D+/ ? $self->{sort_by}: sub {$a cmp $b}}encode_error("hash- or arrayref expected (not a simple scalar, use allow_nonref to allow this)")if(!ref$obj and!$idx->[P_ALLOW_NONREF ]);my$str=$self->object_to_json($obj);$str .= "\n" if ($indent);unless ($ascii or $latin1 or $utf8){utf8::upgrade($str)}if ($idx->[P_SHRINK ]){utf8::downgrade($str,1)}return$str}sub object_to_json {my ($self,$obj)=@_;my$type=ref($obj);if($type eq 'HASH'){return$self->hash_to_json($obj)}elsif($type eq 'ARRAY'){return$self->array_to_json($obj)}elsif ($type){if (blessed($obj)){return$self->value_to_json($obj)if ($obj->isa('JSON::PP::Boolean'));if ($convert_blessed and $obj->can('TO_JSON')){my$result=$obj->TO_JSON();if (defined$result and ref($result)){if (refaddr($obj)eq refaddr($result)){encode_error(sprintf("%s::TO_JSON method returned same object as was passed instead of a new one",ref$obj))}}return$self->object_to_json($result)}return "$obj" if ($bignum and _is_bignum($obj));return$self->blessed_to_json($obj)if ($allow_blessed and $as_nonblessed);encode_error(sprintf("encountered object '%s', but neither allow_blessed " ."nor convert_blessed settings are enabled",$obj))unless ($allow_blessed);return 'null'}else {return$self->value_to_json($obj)}}else{return$self->value_to_json($obj)}}sub hash_to_json {my ($self,$obj)=@_;my@res;encode_error("json text or perl structure exceeds maximum nesting level (max_depth set too low?)")if (++$depth > $max_depth);my ($pre,$post)=$indent ? $self->_up_indent(): ('','');my$del=($space_before ? ' ' : '').':' .($space_after ? ' ' : '');for my$k (_sort($obj)){if (OLD_PERL){utf8::decode($k)}push@res,string_to_json($self,$k).$del .($self->object_to_json($obj->{$k})|| $self->value_to_json($obj->{$k}))}--$depth;$self->_down_indent()if ($indent);return '{' .(@res ? $pre : '').(@res ? join(",$pre",@res).$post : '').'}'}sub array_to_json {my ($self,$obj)=@_;my@res;encode_error("json text or perl structure exceeds maximum nesting level (max_depth set too low?)")if (++$depth > $max_depth);my ($pre,$post)=$indent ? $self->_up_indent(): ('','');for my$v (@$obj){push@res,$self->object_to_json($v)|| $self->value_to_json($v)}--$depth;$self->_down_indent()if ($indent);return '[' .(@res ? $pre : '').(@res ? join(",$pre",@res).$post : '').']'}sub value_to_json {my ($self,$value)=@_;return 'null' if(!defined$value);my$b_obj=B::svref_2object(\$value);my$flags=$b_obj->FLAGS;return$value if$flags & (B::SVp_IOK | B::SVp_NOK)and!($flags & B::SVp_POK);my$type=ref($value);if(!$type){return string_to_json($self,$value)}elsif(blessed($value)and $value->isa('JSON::PP::Boolean')){return $$value==1 ? 'true' : 'false'}elsif ($type){if ((overload::StrVal($value)=~ /=(\w+)/)[0]){return$self->value_to_json("$value")}if ($type eq 'SCALAR' and defined $$value){return $$value eq '1' ? 'true' : $$value eq '0' ? 'false' : $self->{PROPS}->[P_ALLOW_UNKNOWN ]? 'null' : encode_error("cannot encode reference to scalar")}if ($self->{PROPS}->[P_ALLOW_UNKNOWN ]){return 'null'}else {if ($type eq 'SCALAR' or $type eq 'REF'){encode_error("cannot encode reference to scalar")}else {encode_error("encountered $value, but JSON can only represent references to arrays or hashes")}}}else {return$self->{fallback}->($value)if ($self->{fallback}and ref($self->{fallback})eq 'CODE');return 'null'}}my%esc=("\n"=>'\n',"\r"=>'\r',"\t"=>'\t',"\f"=>'\f',"\b"=>'\b',"\""=>'\"',"\\"=>'\\\\',"\'"=>'\\\'',);sub string_to_json {my ($self,$arg)=@_;$arg =~ s/([\x22\x5c\n\r\t\f\b])/$esc{$1}/g;$arg =~ s/\//\\\//g if ($escape_slash);$arg =~ s/([\x00-\x08\x0b\x0e-\x1f])/'\\u00' . unpack('H2', $1)/eg;if ($ascii){$arg=JSON_PP_encode_ascii($arg)}if ($latin1){$arg=JSON_PP_encode_latin1($arg)}if ($utf8){utf8::encode($arg)}return '"' .$arg .'"'}sub blessed_to_json {my$reftype=reftype($_[1])|| '';if ($reftype eq 'HASH'){return $_[0]->hash_to_json($_[1])}elsif ($reftype eq 'ARRAY'){return $_[0]->array_to_json($_[1])}else {return 'null'}}sub encode_error {my$error=shift;Carp::croak "$error"}sub _sort {defined$keysort ? (sort$keysort (keys %{$_[0]})): keys %{$_[0]}}sub _up_indent {my$self=shift;my$space=' ' x $indent_length;my ($pre,$post)=('','');$post="\n" .$space x $indent_count;$indent_count++;$pre="\n" .$space x $indent_count;return ($pre,$post)}sub _down_indent {$indent_count--}sub PP_encode_box {{depth=>$depth,indent_count=>$indent_count,}}}sub _encode_ascii {join('',map {$_ <= 127 ? chr($_): $_ <= 65535 ? sprintf('\u%04x',$_): sprintf('\u%x\u%x',_encode_surrogates($_))}unpack('U*',$_[0]))}sub _encode_latin1 {join('',map {$_ <= 255 ? chr($_): $_ <= 65535 ? sprintf('\u%04x',$_): sprintf('\u%x\u%x',_encode_surrogates($_))}unpack('U*',$_[0]))}sub _encode_surrogates {my$uni=$_[0]- 0x10000;return ($uni / 0x400 + 0xD800,$uni % 0x400 + 0xDC00)}sub _is_bignum {$_[0]->isa('Math::BigInt')or $_[0]->isa('Math::BigFloat')}my$max_intsize;BEGIN {my$checkint=1111;for my$d (5..64){$checkint .= 1;my$int=eval qq| $checkint |;if ($int =~ /[eE]/){$max_intsize=$d - 1;last}}}{my%escapes=(b=>"\x8",t=>"\x9",n=>"\xA",f=>"\xC",r=>"\xD",'\\'=>'\\','"'=>'"','/'=>'/',);my$text;my$at;my$ch;my$len;my$depth;my$encoding;my$is_valid_utf8;my$utf8_len;my$utf8;my$max_depth;my$max_size;my$relaxed;my$cb_object;my$cb_sk_object;my$F_HOOK;my$allow_bigint;my$singlequote;my$loose;my$allow_barekey;sub PP_decode_json {my ($self,$opt);($self,$text,$opt)=@_;($at,$ch,$depth)=(0,'',0);if (!defined$text or ref$text){decode_error("malformed JSON string, neither array, object, number, string or atom")}my$idx=$self->{PROPS};($utf8,$relaxed,$loose,$allow_bigint,$allow_barekey,$singlequote)=@{$idx}[P_UTF8,P_RELAXED,P_LOOSE .. P_ALLOW_SINGLEQUOTE];if ($utf8){utf8::downgrade($text,1)or Carp::croak("Wide character in subroutine entry")}else {utf8::upgrade($text);utf8::encode($text)}$len=length$text;($max_depth,$max_size,$cb_object,$cb_sk_object,$F_HOOK)=@{$self}{qw/max_depth max_size cb_object cb_sk_object F_HOOK/};if ($max_size > 1){use bytes;my$bytes=length$text;decode_error(sprintf("attempted decode of JSON text of %s bytes size, but max_size is set to %s",$bytes,$max_size),1)if ($bytes > $max_size)}my@octets=unpack('C4',$text);$encoding=($octets[0]and $octets[1])? 'UTF-8' : (!$octets[0]and $octets[1])? 'UTF-16BE' : (!$octets[0]and!$octets[1])? 'UTF-32BE' : ($octets[2])? 'UTF-16LE' : (!$octets[2])? 'UTF-32LE' : 'unknown';white();my$valid_start=defined$ch;my$result=value();return undef if (!$result && ($opt & 0x10000000));decode_error("malformed JSON string, neither array, object, number, string or atom")unless$valid_start;if (!$idx->[P_ALLOW_NONREF ]and!ref$result){decode_error('JSON text must be an object or array (but found number, string, true, false or null,' .' use allow_nonref to allow this)',1)}Carp::croak('something wrong.')if$len < $at;my$consumed=defined$ch ? $at - 1 : $at;white();if ($ch){return ($result,$consumed)if ($opt & 0x00000001);decode_error("garbage after JSON object")}($opt & 0x00000001)? ($result,$consumed): $result}sub next_chr {return$ch=undef if($at >= $len);$ch=substr($text,$at++,1)}sub value {white();return if(!defined$ch);return object()if($ch eq '{');return array()if($ch eq '[');return string()if($ch eq '"' or ($singlequote and $ch eq "'"));return number()if($ch =~ /[0-9]/ or $ch eq '-');return word()}sub string {my ($i,$s,$t,$u);my$utf16;my$is_utf8;($is_valid_utf8,$utf8_len)=('',0);$s='';if($ch eq '"' or ($singlequote and $ch eq "'")){my$boundChar=$ch;OUTER: while(defined(next_chr())){if($ch eq $boundChar){next_chr();if ($utf16){decode_error("missing low surrogate character in surrogate pair")}utf8::decode($s)if($is_utf8);return$s}elsif($ch eq '\\'){next_chr();if(exists$escapes{$ch}){$s .= $escapes{$ch}}elsif($ch eq 'u'){my$u='';for(1..4){$ch=next_chr();last OUTER if($ch !~ /[0-9a-fA-F]/);$u .= $ch}if ($u =~ /^[dD][89abAB][0-9a-fA-F]{2}/){$utf16=$u}elsif ($u =~ /^[dD][c-fC-F][0-9a-fA-F]{2}/){unless (defined$utf16){decode_error("missing high surrogate character in surrogate pair")}$is_utf8=1;$s .= JSON_PP_decode_surrogates($utf16,$u)|| next;$utf16=undef}else {if (defined$utf16){decode_error("surrogate pair expected")}if ((my$hex=hex($u))> 127){$is_utf8=1;$s .= JSON_PP_decode_unicode($u)|| next}else {$s .= chr$hex}}}else{unless ($loose){$at -= 2;decode_error('illegal backslash escape sequence in string')}$s .= $ch}}else{if (ord$ch > 127){unless($ch=is_valid_utf8($ch)){$at -= 1;decode_error("malformed UTF-8 character in JSON string")}else {$at += $utf8_len - 1}$is_utf8=1}if (!$loose){if ($ch =~ /[\x00-\x1f\x22\x5c]/){$at--;decode_error('invalid character encountered while parsing JSON string')}}$s .= $ch}}}decode_error("unexpected end of string while parsing JSON string")}sub white {while(defined$ch){if($ch le ' '){next_chr()}elsif($ch eq '/'){next_chr();if(defined$ch and $ch eq '/'){1 while(defined(next_chr())and $ch ne "\n" and $ch ne "\r")}elsif(defined$ch and $ch eq '*'){next_chr();while(1){if(defined$ch){if($ch eq '*'){if(defined(next_chr())and $ch eq '/'){next_chr();last}}else{next_chr()}}else{decode_error("Unterminated comment")}}next}else{$at--;decode_error("malformed JSON string, neither array, object, number, string or atom")}}else{if ($relaxed and $ch eq '#'){pos($text)=$at;$text =~ /\G([^\n]*(?:\r\n|\r|\n|$))/g;$at=pos($text);next_chr;next}last}}}sub array {my$a=$_[0]|| [];decode_error('json text or perl structure exceeds maximum nesting level (max_depth set too low?)')if (++$depth > $max_depth);next_chr();white();if(defined$ch and $ch eq ']'){--$depth;next_chr();return$a}else {while(defined($ch)){push @$a,value();white();if (!defined$ch){last}if($ch eq ']'){--$depth;next_chr();return$a}if($ch ne ','){last}next_chr();white();if ($relaxed and $ch eq ']'){--$depth;next_chr();return$a}}}decode_error(", or ] expected while parsing array")}sub object {my$o=$_[0]|| {};my$k;decode_error('json text or perl structure exceeds maximum nesting level (max_depth set too low?)')if (++$depth > $max_depth);next_chr();white();if(defined$ch and $ch eq '}'){--$depth;next_chr();if ($F_HOOK){return _json_object_hook($o)}return$o}else {while (defined$ch){$k=($allow_barekey and $ch ne '"' and $ch ne "'")? bareKey(): string();white();if(!defined$ch or $ch ne ':'){$at--;decode_error("':' expected")}next_chr();$o->{$k}=value();white();last if (!defined$ch);if($ch eq '}'){--$depth;next_chr();if ($F_HOOK){return _json_object_hook($o)}return$o}if($ch ne ','){last}next_chr();white();if ($relaxed and $ch eq '}'){--$depth;next_chr();if ($F_HOOK){return _json_object_hook($o)}return$o}}}$at--;decode_error(", or } expected while parsing object/hash")}sub bareKey {my$key;while($ch =~ /[^\x00-\x23\x25-\x2F\x3A-\x40\x5B-\x5E\x60\x7B-\x7F]/){$key .= $ch;next_chr()}return$key}sub word {my$word=substr($text,$at-1,4);if($word eq 'true'){$at += 3;next_chr;return$JSON::PP::true}elsif($word eq 'null'){$at += 3;next_chr;return undef}elsif($word eq 'fals'){$at += 3;if(substr($text,$at,1)eq 'e'){$at++;next_chr;return$JSON::PP::false}}$at--;decode_error("'null' expected")if ($word =~ /^n/);decode_error("'true' expected")if ($word =~ /^t/);decode_error("'false' expected")if ($word =~ /^f/);decode_error("malformed JSON string, neither array, object, number, string or atom")}sub number {my$n='';my$v;if($ch eq '0'){my$peek=substr($text,$at,1);my$hex=$peek =~ /[xX]/;if($hex){decode_error("malformed number (leading zero must not be followed by another digit)");($n)=(substr($text,$at+1)=~ /^([0-9a-fA-F]+)/)}else{($n)=(substr($text,$at)=~ /^([0-7]+)/);if (defined$n and length$n > 1){decode_error("malformed number (leading zero must not be followed by another digit)")}}if(defined$n and length($n)){if (!$hex and length($n)==1){decode_error("malformed number (leading zero must not be followed by another digit)")}$at += length($n)+ $hex;next_chr;return$hex ? hex($n): oct($n)}}if($ch eq '-'){$n='-';next_chr;if (!defined$ch or $ch !~ /\d/){decode_error("malformed number (no digits after initial minus)")}}while(defined$ch and $ch =~ /\d/){$n .= $ch;next_chr}if(defined$ch and $ch eq '.'){$n .= '.';next_chr;if (!defined$ch or $ch !~ /\d/){decode_error("malformed number (no digits after decimal point)")}else {$n .= $ch}while(defined(next_chr)and $ch =~ /\d/){$n .= $ch}}if(defined$ch and ($ch eq 'e' or $ch eq 'E')){$n .= $ch;next_chr;if(defined($ch)and ($ch eq '+' or $ch eq '-')){$n .= $ch;next_chr;if (!defined$ch or $ch =~ /\D/){decode_error("malformed number (no digits after exp sign)")}$n .= $ch}elsif(defined($ch)and $ch =~ /\d/){$n .= $ch}else {decode_error("malformed number (no digits after exp sign)")}while(defined(next_chr)and $ch =~ /\d/){$n .= $ch}}$v .= $n;if ($v !~ /[.eE]/ and length$v > $max_intsize){if ($allow_bigint){require Math::BigInt;return Math::BigInt->new($v)}else {return "$v"}}elsif ($allow_bigint){require Math::BigFloat;return Math::BigFloat->new($v)}return 0+$v}sub is_valid_utf8 {$utf8_len=$_[0]=~ /[\x00-\x7F]/ ? 1 : $_[0]=~ /[\xC2-\xDF]/ ? 2 : $_[0]=~ /[\xE0-\xEF]/ ? 3 : $_[0]=~ /[\xF0-\xF4]/ ? 4 : 0 ;return unless$utf8_len;my$is_valid_utf8=substr($text,$at - 1,$utf8_len);return ($is_valid_utf8 =~ /^(?:
Subroutine BEGIN: called CC=3 SCAR=16.0
Subroutine BEGIN: called CC=1 SCAR=2.0
Subroutine PP_decode_json: called CC=25 SCAR=50.8
Subroutine PP_encode_box: not called CC=1 SCAR=2.0
Subroutine PP_encode_json: called CC=12 SCAR=37.7
Subroutine __ANON__: not called CC=1 SCAR=2.0
Subroutine __ANON__: not called CC=1 SCAR=2.0
Subroutine __ANON__: not called CC=1 SCAR=2.0
Subroutine _down_indent: not called CC=1 SCAR=2.0
Subroutine _encode_ascii: not called CC=3 SCAR=16.0
Subroutine _encode_latin1: not called CC=3 SCAR=16.0
Subroutine _encode_surrogates: not called CC=1 SCAR=2.0
Subroutine _is_bignum: not called CC=2 SCAR=10.5
Subroutine _sort: called CC=2 SCAR=10.5
Subroutine _up_indent: not called CC=1 SCAR=2.0
Subroutine allow_bigint: not called CC=1 SCAR=2.0
Subroutine array: called CC=11 SCAR=36.2
Subroutine array_to_json: called CC=8 SCAR=30.8
Subroutine bareKey: not called CC=2 SCAR=10.5
Subroutine blessed_to_json: not called CC=4 SCAR=20.1
Subroutine decode: called CC=1 SCAR=2.0
Subroutine decode_json: not called CC=2 SCAR=10.5
Subroutine decode_prefix: not called CC=1 SCAR=2.0
Subroutine encode: called CC=1 SCAR=2.0
Subroutine encode_error: not called CC=1 SCAR=2.0
Subroutine encode_json: not called CC=2 SCAR=10.5
Subroutine filter_json_object: not called CC=4 SCAR=20.1
Subroutine filter_json_single_key_object: not called CC=4 SCAR=20.1
Subroutine from_json: not called CC=1 SCAR=2.0
Subroutine get_indent_length: not called CC=1 SCAR=2.0
Subroutine get_max_depth: not called CC=1 SCAR=2.0
Subroutine get_max_size: not called CC=1 SCAR=2.0
Subroutine hash_to_json: called CC=10 SCAR=34.5
Subroutine indent_length: not called CC=4 SCAR=20.1
Subroutine is_valid_utf8: called CC=7 SCAR=28.7
Subroutine max_depth: not called CC=2 SCAR=10.5
Subroutine max_size: not called CC=2 SCAR=10.5
Subroutine new: called CC=1 SCAR=2.0
Subroutine next_chr: called CC=2 SCAR=10.5
Subroutine number: called CC=37 SCAR=58.1
Subroutine object: called CC=19 SCAR=45.8
Subroutine object_to_json: called CC=16 SCAR=42.7
Subroutine pretty: not called CC=3 SCAR=16.0
Subroutine sort_by: not called CC=2 SCAR=10.5
Subroutine string: called CC=25 SCAR=50.8
Subroutine string_to_json: called CC=5 SCAR=23.4
Subroutine to_json: not called CC=1 SCAR=2.0
Subroutine value: called CC=9 SCAR=32.8
Subroutine value_to_json: called CC=20 SCAR=46.7
Subroutine white: called CC=17 SCAR=43.8
Subroutine word: not called CC=8 SCAR=30.8
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod documented
Pod undocumented
Pod undocumented
Pod undocumented
Pod documented
Pod documented
Pod documented
Pod documented
Pod undocumented
Pod documented
Pod documented
Pod documented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod documented
Pod undocumented
Pod documented
Pod documented
Pod documented
Pod undocumented
Pod documented
Pod documented
Pod undocumented
Pod documented
Pod documented
Pod documented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Branch: 174 branches
BranchTrueFalseTotal
if ($int =~ /[eE]/) 2 32 34
if (not defined $text or ref $text) 0 6 6
if ($utf8) { } 4 2 6
utf8::downgrade($text, 1) or Carp::croak("Wide character in subroutine entry") 4 0 4
if ($max_size > 1) 0 6 6
if $bytes > $max_size 0 0 0
$octets[0] && $octets[1] ? : 6 0 6
!$octets[0] && $octets[1] ? : 0 0 0
!($octets[0] || $octets[1]) ? : 0 0 0
$octets[2] ? : 0 0 0
!$octets[2] ? : 0 0 0
if not $result and $opt & 268435456 0 6 6
unless $valid_start 0 6 6
unless ($idx->[7] or ref $result) 0 6 6
if $len < $at 0 6 6
defined $ch ? : 2 4 6
if ($ch) 0 6 6
if $opt & 1 0 0 0
$opt & 1 ? : 0 6 6
$canonical ? : 0 4 4
if ($self->{"sort_by"}) 0 4 4
ref $self->{'sort_by'} eq 'CODE' ? : 0 0 0
$self->{'sort_by'} =~ /\D+/ ? : 0 0 0
unless ref $obj or $idx->[7] 0 4 4
if $indent 0 4 4
unless ($ascii or $latin1 or $utf8) 0 4 4
if ($idx->[8]) 0 4 4
$_ <= 127 ? : 0 0 0
$_ <= 65535 ? : 0 0 0
$_ <= 255 ? : 0 0 0
$_ <= 65535 ? : 0 0 0
$_[0]->isa("Math::BigInt") or $_[0]->isa("Math::BigFloat") 0 0 0
defined $keysort ? : 0 620 620
if ++$depth > $max_depth 0 24 24
if (defined $ch and $ch eq ']') { } 0 24 24
if (defined $ch) 192 0 192
unless (defined $ch) 0 192 192
if ($ch eq "]") 24 168 192
if ($ch ne ",") 0 168 168
if ($relaxed and $ch eq "]") 0 168 168
if ++$depth > $max_depth 0 16 16
$indent ? : 0 16 16
if $indent 0 16 16
@res ? : 16 0 16
@res ? : 16 0 16
if ($ch =~ /[^\x00-\x23\x25-\x2F\x3A-\x40\x5B-\x5E\x60\x7B-\x7F]/) 0 0 0
if ($reftype eq 'HASH') { } 0 0 0
elsif ($reftype eq 'ARRAY') { } 0 0 0
defined $_[1] ? : 0 0 0
$_[0]{'cb_object'} || $_[0]{'cb_sk_object'} ? : 0 0 0
if (@_ > 1) 0 0 0
$_[0]{'cb_object'} || $_[0]{'cb_sk_object'} ? : 0 0 0
if ++$depth > $max_depth 0 620 620
$indent ? : 0 620 620
$space_before ? : 0 620 620
$space_after ? : 0 620 620
if $indent 0 620 620
@res ? : 620 0 620
@res ? : 620 0 620
if (not defined $_[1] or $_[1] > 15 or $_[1] < 0) { } 0 0 0
$_[0] =~ /[\x00-\x7F]/ ? : 0 6 6
$_[0] =~ /[\xC2-\xDF]/ ? : 6 0 6
$_[0] =~ /[\xE0-\xEF]/ ? : 0 0 0
$_[0] =~ /[\xF0-\xF4]/ ? : 0 0 0
unless $utf8_len 0 6 6
$is_valid_utf8 =~ /^(?: [\x00-\x7F] |[\xC2-\xDF][\x80-\xBF] |[\xE0][\xA0-\xBF][\x80-\xBF] |[\xE1-\xEC][\x80-\xBF][\x80-\xBF] |[\xED][\x80-\x9F][\x80-\xBF] |[\xEE-\xEF][\x80-\xBF][\x80-\xBF] |[\xF0][\x90-\xBF][\x80-\xBF][\x80-\xBF] |[\xF1-\xF3][\x80-\xBF][\x80-\xBF][\x80-\xBF] |[\xF4][\x80-\x8F][\x80-\xBF][\x80-\xBF] )$/x ? : 6 0 6
defined $_[1] ? : 0 0 0
defined $_[1] ? : 0 0 0
if $at >= $len 6 109602 109608
if ($ch eq 0) 6 4 10
if ($hex) { } 0 6 6
if (defined $n and length $n > 1) 0 6 6
if (defined $n and length $n) 0 6 6
if (not $hex and length $n == 1) 0 0 0
$hex ? : 0 0 0
if ($ch eq "-") 0 10 10
unless (defined $ch and $ch =~ /\d/) 0 0 0
if (defined $ch and $ch =~ /\d/) 10 10 20
if (defined $ch and $ch eq ".") 0 10 10
if (not defined $ch && $ch =~ /\d/) { } 0 0 0
if (defined next_chr() and $ch =~ /\d/) 0 0 0
if (defined $ch and $ch eq "e" || $ch eq "E") 0 10 10
if (defined $ch and $ch eq '+' || $ch eq '-') { } 0 0 0
elsif (defined $ch and $ch =~ /\d/) { } 0 0 0
if (not defined $ch or $ch =~ /\D/) 0 0 0
if (defined next_chr() and $ch =~ /\d/) 0 0 0
if (not $v =~ /[.eE]/ and length $v > $max_intsize) { } 0 10 10
elsif ($allow_bigint) { } 0 10 10
if ($allow_bigint) { } 0 0 0
if ++$depth > $max_depth 0 930 930
if (defined $ch and $ch eq '}') { } 0 930 930
if ($F_HOOK) 0 0 0
if (defined $ch) 3432 0 3432
$allow_barekey && $ch ne '"' && $ch ne q['] ? : 0 3432 3432
if (not defined $ch or $ch ne ":") 0 3432 3432
unless defined $ch 0 3432 3432
if ($ch eq "}") 930 2502 3432
if ($F_HOOK) 0 930 930
if ($ch ne ",") 0 2502 2502
if ($relaxed and $ch eq "}") 0 2502 2502
if ($F_HOOK) 0 0 0
if ($type eq 'HASH') { } 620 1802 2422
elsif ($type eq 'ARRAY') { } 16 1786 1802
elsif ($type) { } 2 1784 1786
if (&blessed($obj)) { } 2 0 2
if $obj->isa("JSON::PP::Boolean") 0 2 2
if ($convert_blessed and $obj->can("TO_JSON")) 2 0 2
if (defined $result and ref $result) 2 0 2
if (&refaddr($obj) eq &refaddr($result)) 0 2 2
if $bignum and _is_bignum($obj) 0 0 0
if $allow_blessed and $as_nonblessed 0 0 0
unless $allow_blessed 0 0 0
defined $v ? : 0 0 0
if ($enable) { } 0 0 0
defined $_[1] ? : 0 0 0
if ($ch eq "\"" or $singlequote and $ch eq "'") 6098 0 6098
if (defined next_chr()) 79338 0 79338
if ($ch eq $boundChar) { } 6098 73240 79338
elsif ($ch eq '\\') { } 0 73240 73240
if ($utf16) 0 6098 6098
if $is_utf8 6 6092 6098
if (exists $escapes{$ch}) { } 0 0 0
elsif ($ch eq 'u') { } 0 0 0
unless $ch =~ /[0-9a-fA-F]/ 0 0 0
if ($u =~ /^[dD][89abAB][0-9a-fA-F]{2}/) { } 0 0 0
elsif ($u =~ /^[dD][c-fC-F][0-9a-fA-F]{2}/) { } 0 0 0
unless (defined $utf16) 0 0 0
if (defined $utf16) 0 0 0
if ((my $hex = hex $u) > 127) { } 0 0 0
unless ($loose) 0 0 0
if (ord $ch > 127) 6 73234 73240
if ($ch = is_valid_utf8($ch)) { } 6 0 6
unless ($loose) 73240 0 73240
if ($ch =~ /[\x00-\x1f\x22\x5c]/) 0 73240 73240
if $escape_slash 0 4066 4066
if ($ascii) 0 4066 4066
if ($latin1) 0 4066 4066
if ($utf8) 4066 0 4066
unless defined $ch 0 3630 3630
if $ch eq "{" 930 2700 3630
if $ch eq "[" 24 2676 2700
if $ch eq "\"" or $singlequote and $ch eq "'" 2666 10 2676
if $ch =~ /[0-9]/ or $ch eq "-" 10 0 10
unless defined $value 0 1788 1788
if $flags & 12288 and not $flags & 16384 10 1778 1788
if (not $type) { } 1778 0 1778
elsif (&blessed($value) and $value->isa('JSON::PP::Boolean')) { } 0 0 0
elsif ($type) { } 0 0 0
$$value == 1 ? : 0 0 0
if ((overload::StrVal($value) =~ /=(\w+)/)[0]) 0 0 0
if ($type eq "SCALAR" and defined $$value) 0 0 0
$$value eq '1' ? : 0 0 0
$$value eq '0' ? : 0 0 0
$self->{'PROPS'}[18] ? : 0 0 0
if ($self->{'PROPS'}[18]) { } 0 0 0
if ($type eq 'SCALAR' or $type eq 'REF') { } 0 0 0
if $self->{"fallback"} and ref $self->{"fallback"} eq "CODE" 0 0 0
if (defined $ch) 30468 6 30474
if ($ch le ' ') { } 16152 14316 30468
elsif ($ch eq '/') { } 0 14316 14316
if (defined $ch and $ch eq '/') { } 0 0 0
elsif (defined $ch and $ch eq '*') { } 0 0 0
defined next_chr() and $ch ne "\n" and $ch ne "\r" and do { '???' } 0 0 0
if (defined $ch) { } 0 0 0
if ($ch eq '*') { } 0 0 0
if (defined next_chr() and $ch eq "/") 0 0 0
if ($relaxed and $ch eq "#") 0 14316 14316
if ($word eq 'true') { } 0 0 0
elsif ($word eq 'null') { } 0 0 0
elsif ($word eq 'fals') { } 0 0 0
if (substr($text, $at, 1) eq "e") 0 0 0
if $word =~ /^n/ 0 0 0
if $word =~ /^t/ 0 0 0
if $word =~ /^f/ 0 0 0
Condition20%38/190
not defined $text or ref $text
l!l&&r!l&&!r
006
$octets[0] and $octets[1]
!ll&&!rl&&r
006
not $octets[0] and $octets[1]
!ll&&!rl&&r
000
$octets[0] || $octets[1]
l!l&&r!l&&!r
000
not $result and $opt & 268435456
!ll&&!rl&&r
600
$idx->[7] or ref $result
l!l&&r!l&&!r
060
ref $obj or $idx->[7]
l!l&&r!l&&!r
400
$ascii or $latin1 or $utf8
l!l&&r!l&&!r
040
$ascii or $latin1
l!l&&r!l&&!r
004
$_[0] || []
l!l
024
defined $ch and $ch eq "]"
!ll&&!rl&&r
0240
$relaxed and $ch eq "]"
!ll&&!rl&&r
16800
$self->object_to_json($v) || $self->value_to_json($v)
l!l&&r!l&&!r
12800
&reftype($_[1]) || ''
l!l
00
$JSON ||= __PACKAGE__->new->utf8
l!l&&r!l&&!r
000
$JSON ||= __PACKAGE__->new->utf8
l!l&&r!l&&!r
000
$_[0]{"cb_object"} or $_[0]{"cb_sk_object"}
l!l&&r!l&&!r
000
$_[0]{"cb_object"} or $_[0]{"cb_sk_object"}
l!l&&r!l&&!r
000
$self->object_to_json($obj->{$k}) || $self->value_to_json($obj->{$k})
l!l&&r!l&&!r
228404
not defined $_[1] or $_[1] > 15 or $_[1] < 0
l!l&&r!l&&!r
000
not defined $_[1] or $_[1] > 15
l!l&&r!l&&!r
000
defined $n and length $n > 1
!ll&&!rl&&r
600
defined $n and length $n
!ll&&!rl&&r
600
not $hex and length $n == 1
!ll&&!rl&&r
000
defined $ch and $ch =~ /\d/
!ll&&!rl&&r
000
defined $ch and $ch =~ /\d/
!ll&&!rl&&r
01010
defined $ch and $ch eq "."
!ll&&!rl&&r
0100
defined $ch && $ch =~ /\d/
!ll&&!rl&&r
000
defined next_chr() and $ch =~ /\d/
!ll&&!rl&&r
000
defined $ch and $ch eq "e" || $ch eq "E"
!ll&&!rl&&r
0100
$ch eq "e" or $ch eq "E"
l!l&&r!l&&!r
0010
defined $ch and $ch eq "+" || $ch eq "-"
!ll&&!rl&&r
000
$ch eq "+" or $ch eq "-"
l!l&&r!l&&!r
000
not defined $ch or $ch =~ /\D/
l!l&&r!l&&!r
000
defined $ch and $ch =~ /\d/
!ll&&!rl&&r
000
defined next_chr() and $ch =~ /\d/
!ll&&!rl&&r
000
not $v =~ /[.eE]/ and length $v > $max_intsize
!ll&&!rl&&r
0100
$_[0] || {}
l!l
0930
defined $ch and $ch eq "}"
!ll&&!rl&&r
09300
$allow_barekey and $ch ne "\"" and $ch ne "'"
!ll&&!rl&&r
343200
$allow_barekey and $ch ne "\""
!ll&&!rl&&r
343200
not defined $ch or $ch ne ":"
l!l&&r!l&&!r
003432
$relaxed and $ch eq "}"
!ll&&!rl&&r
250200
$convert_blessed and $obj->can("TO_JSON")
!ll&&!rl&&r
002
defined $result and ref $result
!ll&&!rl&&r
002
$bignum and _is_bignum($obj)
!ll&&!rl&&r
000
$allow_blessed and $as_nonblessed
!ll&&!rl&&r
000
$ch eq "\"" or $singlequote and $ch eq "'"
l!l&&r!l&&!r
609800
$singlequote and $ch eq "'"
!ll&&!rl&&r
000
JSON_PP_decode_surrogates($utf16, $u) || (next)
l!l
00
JSON_PP_decode_unicode($u) || (next)
l!l
00
$ch eq "\"" or $singlequote and $ch eq "'"
l!l&&r!l&&!r
2666010
$singlequote and $ch eq "'"
!ll&&!rl&&r
1000
$ch =~ /[0-9]/ or $ch eq "-"
l!l&&r!l&&!r
1000
$flags & 12288 and not $flags & 16384
!ll&&!rl&&r
1776210
&blessed($value) and $value->isa("JSON::PP::Boolean")
!ll&&!rl&&r
000
$type eq "SCALAR" and defined $$value
!ll&&!rl&&r
000
$type eq "SCALAR" or $type eq "REF"
l!l&&r!l&&!r
000
$self->{"fallback"} and ref $self->{"fallback"} eq "CODE"
!ll&&!rl&&r
000
defined $ch and $ch eq "/"
!ll&&!rl&&r
000
defined next_chr() and $ch ne "\n" and $ch ne "\r"
!ll&&!rl&&r
000
defined next_chr() and $ch ne "\n"
!ll&&!rl&&r
000
defined $ch and $ch eq "*"
!ll&&!rl&&r
000
defined next_chr() and $ch eq "/"
!ll&&!rl&&r
000
$relaxed and $ch eq "#"
!ll&&!rl&&r
1431600
MC/DC0%0/2
not defined $text or ref $text
not defined $text ref $text
MC/DC0%0/2
$octets[0] and $octets[1]
$octets[0] $octets[1]
MC/DC0%0/2
not $octets[0] and $octets[1]
not $octets[0] $octets[1]
MC/DC0%0/2
$octets[0] || $octets[1]
$octets[0] $octets[1]
MC/DC0%0/2
not $result and $opt & 268435456
not $result $opt & 268435456
MC/DC0%0/2
$idx->[7] or ref $result
$idx->[7] ref $result
MC/DC0%0/2
ref $obj or $idx->[7]
ref $obj $idx->[7]
MC/DC0%0/3
$ascii or $latin1 or $utf8
$ascii $latin1 $utf8
MC/DC0%0/1
$_[0] || []
$_[0]
MC/DC0%0/2
defined $ch and $ch eq "]"
defined $ch $ch eq "]"
MC/DC0%0/2
$relaxed and $ch eq "]"
$relaxed $ch eq "]"
MC/DC0%0/2
$self->object_to_json($v) || $self->value_to_json($v)
$self->object_to_json($v) $self->value_to_json($v)
MC/DC0%0/1
&reftype($_[1]) || ''
&reftype($_[1])
MC/DC0%0/2
$JSON ||= __PACKAGE__->new->utf8
$JSON __PACKAGE__->new->utf8
MC/DC0%0/2
$JSON ||= __PACKAGE__->new->utf8
$JSON __PACKAGE__->new->utf8
MC/DC0%0/2
$_[0]{"cb_object"} or $_[0]{"cb_sk_object"}
$_[0]{"cb_object"} $_[0]{"cb_sk_object"}
MC/DC0%0/2
$_[0]{"cb_object"} or $_[0]{"cb_sk_object"}
$_[0]{"cb_object"} $_[0]{"cb_sk_object"}
MC/DC50%1/2
$self->object_to_json($obj->{$k}) || $self->value_to_json($obj->{$k})
$self->object_to_json($obj->{$k}) $self->value_to_json($obj->{$k})
MC/DC0%0/3
not defined $_[1] or $_[1] > 15 or $_[1] < 0
not defined $_[1] $_[1] > 15 $_[1] < 0
MC/DC0%0/2
defined $n and length $n > 1
defined $n length $n > 1
MC/DC0%0/2
defined $n and length $n
defined $n length $n
MC/DC0%0/2
not $hex and length $n == 1
not $hex length $n == 1
MC/DC0%0/2
defined $ch and $ch =~ /\d/
defined $ch $ch =~ /\d/
MC/DC50%1/2
defined $ch and $ch =~ /\d/
defined $ch $ch =~ /\d/
MC/DC0%0/2
defined $ch and $ch eq "."
defined $ch $ch eq "."
MC/DC0%0/2
defined $ch && $ch =~ /\d/
defined $ch $ch =~ /\d/
MC/DC0%0/2
defined next_chr() and $ch =~ /\d/
defined next_chr() $ch =~ /\d/
MC/DC0%0/3
defined $ch and $ch eq "e" || $ch eq "E"
defined $ch $ch eq "e" $ch eq "E"
MC/DC0%0/3
defined $ch and $ch eq "+" || $ch eq "-"
defined $ch $ch eq "+" $ch eq "-"
MC/DC0%0/2
not defined $ch or $ch =~ /\D/
not defined $ch $ch =~ /\D/
MC/DC0%0/2
defined $ch and $ch =~ /\d/
defined $ch $ch =~ /\d/
MC/DC0%0/2
defined next_chr() and $ch =~ /\d/
defined next_chr() $ch =~ /\d/
MC/DC0%0/2
not $v =~ /[.eE]/ and length $v > $max_intsize
not $v =~ /[.eE]/ length $v > $max_intsize
MC/DC0%0/1
$_[0] || {}
$_[0]
MC/DC0%0/2
defined $ch and $ch eq "}"
defined $ch $ch eq "}"
MC/DC0%0/3
$allow_barekey and $ch ne "\"" and $ch ne "'"
$allow_barekey $ch ne "\"" $ch ne "'"
MC/DC0%0/2
not defined $ch or $ch ne ":"
not defined $ch $ch ne ":"
MC/DC0%0/2
$relaxed and $ch eq "}"
$relaxed $ch eq "}"
MC/DC0%0/2
$convert_blessed and $obj->can("TO_JSON")
$convert_blessed $obj->can("TO_JSON")
MC/DC0%0/2
defined $result and ref $result
defined $result ref $result
MC/DC0%0/2
$bignum and _is_bignum($obj)
$bignum _is_bignum($obj)
MC/DC0%0/2
$allow_blessed and $as_nonblessed
$allow_blessed $as_nonblessed
MC/DC0%0/3
$ch eq "\"" or $singlequote and $ch eq "'"
$ch eq "\"" $singlequote $ch eq "'"
MC/DC0%0/1
JSON_PP_decode_surrogates($utf16, $u) || (next)
JSON_PP_decode_surrogates($utf16, $u)
MC/DC0%0/1
JSON_PP_decode_unicode($u) || (next)
JSON_PP_decode_unicode($u)
MC/DC33%1/3
$ch eq "\"" or $singlequote and $ch eq "'"
$ch eq "\"" $singlequote $ch eq "'"
MC/DC0%0/2
$ch =~ /[0-9]/ or $ch eq "-"
$ch =~ /[0-9]/ $ch eq "-"
MC/DC100%2/2
$flags & 12288 and not $flags & 16384
$flags & 12288 not $flags & 16384
MC/DC0%0/2
&blessed($value) and $value->isa("JSON::PP::Boolean")
&blessed($value) $value->isa("JSON::PP::Boolean")
MC/DC0%0/2
$type eq "SCALAR" and defined $$value
$type eq "SCALAR" defined $$value
MC/DC0%0/2
$type eq "SCALAR" or $type eq "REF"
$type eq "SCALAR" $type eq "REF"
MC/DC0%0/2
$self->{"fallback"} and ref $self->{"fallback"} eq "CODE"
$self->{"fallback"} ref $self->{"fallback"} eq "CODE"
MC/DC0%0/2
defined $ch and $ch eq "/"
defined $ch $ch eq "/"
MC/DC0%0/3
defined next_chr() and $ch ne "\n" and $ch ne "\r"
defined next_chr() $ch ne "\n" $ch ne "\r"
MC/DC0%0/2
defined $ch and $ch eq "*"
defined $ch $ch eq "*"
MC/DC0%0/2
defined next_chr() and $ch eq "/"
defined next_chr() $ch eq "/"
MC/DC0%0/2
$relaxed and $ch eq "#"
$relaxed $ch eq "#"
Truth table33%1/3
not(A) or B
A= not defined $textB= ref $text
ABresult
1X1
011
000
Truth table33%1/3
A and B
A= $octets[0]B= $octets[1]
ABresult
0X0
100
111
Truth table0%0/3
not(A) and B
A= not $octets[0]B= $octets[1]
ABresult
0X0
100
111
Truth table0%0/3
A || B
A= $octets[0]B= $octets[1]
ABresult
1X1
011
000
Truth table33%1/3
not(A) and B
A= not $resultB= $opt & 268435456
ABresult
0X0
100
111
Truth table33%1/3
A or B
A= $idx->[7]B= ref $result
ABresult
1X1
011
000
Truth table33%1/3
A or B
A= ref $objB= $idx->[7]
ABresult
1X1
011
000
Truth table25%1/4
A or B or C
A= $asciiB= $latin1C= $utf8
ABCresult
1XX1
01X1
0011
0000
Truth table50%1/2
A
A= $_[0]
Aresult
11
00
Truth table33%1/3
A and B
A= defined $chB= $ch eq "]"
ABresult
0X0
100
111
Truth table33%1/3
A and B
A= $relaxedB= $ch eq "]"
ABresult
0X0
100
111
Truth table33%1/3
A || B
A= $self->object_to_json($v)B= $self->value_to_json($v)
ABresult
1X1
011
000
Truth table0%0/2
A
A= &reftype($_[1])
Aresult
11
00
Truth table0%0/3
A ||= B
A= $JSONB= __PACKAGE__->new->utf8
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $JSONB= __PACKAGE__->new->utf8
ABresult
1X1
011
000
Truth table0%0/3
A or B
A= $_[0]{"cb_object"}B= $_[0]{"cb_sk_object"}
ABresult
1X1
011
000
Truth table0%0/3
A or B
A= $_[0]{"cb_object"}B= $_[0]{"cb_sk_object"}
ABresult
1X1
011
000
Truth table66%2/3
A || B
A= $self->object_to_json($obj->{$k})B= $self->value_to_json($obj->{$k})
ABresult
1X1
011
000
Truth table0%0/4
not(A) or B or C
A= not defined $_[1]B= $_[1] > 15C= $_[1] < 0
ABCresult
1XX1
01X1
0011
0000
Truth table33%1/3
A and B
A= defined $nB= length $n > 1
ABresult
0X0
100
111
Truth table33%1/3
A and B
A= defined $nB= length $n
ABresult
0X0
100
111
Truth table0%0/3
not(A) and B
A= not $hexB= length $n == 1
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $chB= $ch =~ /\d/
ABresult
0X0
100
111
Truth table66%2/3
A and B
A= defined $chB= $ch =~ /\d/
ABresult
0X0
100
111
Truth table33%1/3
A and B
A= defined $chB= $ch eq "."
ABresult
0X0
100
111
Truth table0%0/3
A && B
A= defined $chB= $ch =~ /\d/
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined next_chr()B= $ch =~ /\d/
ABresult
0X0
100
111
Truth table25%1/4
A and B or C
A= defined $chB= $ch eq "e"C= $ch eq "E"
ABCresult
0XX0
1000
11X1
1011
Truth table0%0/4
A and B or C
A= defined $chB= $ch eq "+"C= $ch eq "-"
ABCresult
0XX0
1000
11X1
1011
Truth table0%0/3
not(A) or B
A= not defined $chB= $ch =~ /\D/
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= defined $chB= $ch =~ /\d/
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined next_chr()B= $ch =~ /\d/
ABresult
0X0
100
111
Truth table33%1/3
not(A) and B
A= not $v =~ /[.eE]/B= length $v > $max_intsize
ABresult
0X0
100
111
Truth table50%1/2
A
A= $_[0]
Aresult
11
00
Truth table33%1/3
A and B
A= defined $chB= $ch eq "}"
ABresult
0X0
100
111
Truth table25%1/4
A and B and C
A= $allow_barekeyB= $ch ne "\""C= $ch ne "'"
ABCresult
0XX0
10X0
1100
1111
Truth table33%1/3
not(A) or B
A= not defined $chB= $ch ne ":"
ABresult
1X1
011
000
Truth table33%1/3
A and B
A= $relaxedB= $ch eq "}"
ABresult
0X0
100
111
Truth table33%1/3
A and B
A= $convert_blessedB= $obj->can("TO_JSON")
ABresult
0X0
100
111
Truth table33%1/3
A and B
A= defined $resultB= ref $result
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $bignumB= _is_bignum($obj)
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $allow_blessedB= $as_nonblessed
ABresult
0X0
100
111
Truth table25%1/4
A or B and C
A= $ch eq "\""B= $singlequoteC= $ch eq "'"
ABCresult
1XX1
0111
00X0
0100
Truth table0%0/2
A
A= JSON_PP_decode_surrogates($utf16, $u)
Aresult
11
00
Truth table0%0/2
A
A= JSON_PP_decode_unicode($u)
Aresult
11
00
Truth table50%2/4
A or B and C
A= $ch eq "\""B= $singlequoteC= $ch eq "'"
ABCresult
1XX1
0111
00X0
0100
Truth table33%1/3
A or B
A= $ch =~ /[0-9]/B= $ch eq "-"
ABresult
1X1
011
000
Truth table100%3/3
A and not(B)
A= $flags & 12288B= not $flags & 16384
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= &blessed($value)B= $value->isa("JSON::PP::Boolean")
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $type eq "SCALAR"B= defined $$value
ABresult
0X0
100
111
Truth table0%0/3
A or B
A= $type eq "SCALAR"B= $type eq "REF"
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= $self->{"fallback"}B= ref $self->{"fallback"} eq "CODE"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $chB= $ch eq "/"
ABresult
0X0
100
111
Truth table0%0/4
A and B and C
A= defined next_chr()B= $ch ne "\n"C= $ch ne "\r"
ABCresult
0XX0
10X0
1100
1111
Truth table0%0/3
A and B
A= defined $chB= $ch eq "*"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined next_chr()B= $ch eq "/"
ABresult
0X0
100
111
Truth table33%1/3
A and B
A= $relaxedB= $ch eq "#"
ABresult
0X0
100
111
253 [\x00-\x7F]
254 |[\xC2-\xDF][\x80-\xBF]
255 |[\xE0][\xA0-\xBF][\x80-\xBF]
256 |[\xE1-\xEC][\x80-\xBF][\x80-\xBF]
257 |[\xED][\x80-\x9F][\x80-\xBF]
258 |[\xEE-\xEF][\x80-\xBF][\x80-\xBF]
259 |[\xF0][\x90-\xBF][\x80-\xBF][\x80-\xBF]
260 |[\xF1-\xF3][\x80-\xBF][\x80-\xBF][\x80-\xBF]
261 |[\xF4][\x80-\x8F][\x80-\xBF][\x80-\xBF]
262 0 ▶ )$/x)? $is_valid_utf8 : ''}sub decode_error {my$error=shift;my$no_rep=shift;my$str=defined$text ? substr($text,$at): '';my$mess='';my$type=$] >= 5.008 ? 'U*' : $] < 5.006 ? 'C*' : utf8::is_utf8($str)? 'U*' : 'C*' ;for my$c (unpack($type,$str)){$mess .= $c==0x07 ? '\a' : $c==0x09 ? '\t' : $c==0x0a ? '\n' : $c==0x0d ? '\r' : $c==0x0c ? '\f' : $c < 0x20 ? sprintf('\x{%x}',$c): $c==0x5c ? '\\\\' : $c < 0x80 ? chr($c): sprintf('\x{%x}',$c);if (length$mess >= 20){$mess .= '...';last}}unless (length$mess){$mess='(end of string)'}Carp::croak ($no_rep ? "$error" : "$error, at character offset $at (before \"$mess\")")}sub _json_object_hook {my$o=$_[0];my@ks=keys %{$o};if ($cb_sk_object and @ks==1 and exists$cb_sk_object->{$ks[0]}and ref$cb_sk_object->{$ks[0]}){my@val=$cb_sk_object->{$ks[0]}->($o->{$ks[0]});if (@val==1){return$val[0]}}my@val=$cb_object->($o)if ($cb_object);if (@val==0 or @val > 1){return$o}else {return$val[0]}}sub PP_decode_box {{text=>$text,at=>$at,ch=>$ch,len=>$len,depth=>$depth,encoding=>$encoding,is_valid_utf8=>$is_valid_utf8,}}}sub _decode_surrogates {my$uni=0x10000 + (hex($_[0])- 0xD800)* 0x400 + (hex($_[1])- 0xDC00);my$un=pack('U*',$uni);utf8::encode($un);return$un}sub _decode_unicode {my$un=pack('U',hex shift);utf8::encode($un);return$un}BEGIN {unless (defined&utf8::is_utf8){require Encode;*utf8::is_utf8=*Encode::is_utf8}if ($] >= 5.008){*JSON::PP::JSON_PP_encode_ascii=\&_encode_ascii;*JSON::PP::JSON_PP_encode_latin1=\&_encode_latin1;*JSON::PP::JSON_PP_decode_surrogates=\&_decode_surrogates;*JSON::PP::JSON_PP_decode_unicode=\&_decode_unicode}if ($] >= 5.008 and $] < 5.008003){package JSON::PP;require subs;subs->import('join');eval q|
Subroutine BEGIN: called CC=6 SCAR=34.5
Subroutine PP_decode_box: not called CC=1 SCAR=5.3
Subroutine _decode_surrogates: not called CC=1 SCAR=5.3
Subroutine _decode_unicode: not called CC=1 SCAR=5.3
Subroutine _json_object_hook: not called CC=9 SCAR=41.8
Subroutine decode_error: not called CC=17 SCAR=53.8
Pod undocumented
Pod undocumented
Branch: 22 branches
BranchTrueFalseTotal
unless (defined &utf8::is_utf8) 0 2 2
if ($] >= "5.008") 2 0 2
if ($] >= "5.008" and $] < "5.008003") 0 2 2
if ($cb_sk_object and @ks == 1 and exists $$cb_sk_object{$ks[0]} and ref $$cb_sk_object{$ks[0]}) 0 0 0
if (@val == 1) 0 0 0
if $cb_object 0 0 0
if (@val == 0 or @val > 1) { } 0 0 0
defined $text ? : 0 0 0
$] >= 5.008 ? : 0 0 0
$] < 5.006 ? : 0 0 0
utf8::is_utf8($str) ? : 0 0 0
$c == 7 ? : 0 0 0
$c == 9 ? : 0 0 0
$c == 10 ? : 0 0 0
$c == 13 ? : 0 0 0
$c == 12 ? : 0 0 0
$c < 32 ? : 0 0 0
$c == 92 ? : 0 0 0
$c < 128 ? : 0 0 0
if (length $mess >= 20) 0 0 0
unless (length $mess) 0 0 0
$no_rep ? : 0 0 0
Condition6%1/15
$] >= "5.008" and $] < "5.008003"
!ll&&!rl&&r
020
$cb_sk_object and @ks == 1 and exists $$cb_sk_object{$ks[0]} and ref $$cb_sk_object{$ks[0]}
!ll&&!rl&&r
000
$cb_sk_object and @ks == 1 and exists $$cb_sk_object{$ks[0]}
!ll&&!rl&&r
000
$cb_sk_object and @ks == 1
!ll&&!rl&&r
000
@val == 0 or @val > 1
l!l&&r!l&&!r
000
MC/DC0%0/2
$] >= "5.008" and $] < "5.008003"
$] >= "5.008" $] < "5.008003"
MC/DC0%0/4
$cb_sk_object and @ks == 1 and exists $$cb_sk_object{$ks[0]} and ref $$cb_sk_object{$ks[0]}
$cb_sk_object @ks == 1 exists $$cb_sk_object{$ks[0]} ref $$cb_sk_object{$ks[0]}
MC/DC0%0/2
@val == 0 or @val > 1
@val == 0 @val > 1
Truth table33%1/3
A and B
A= $] >= "5.008"B= $] < "5.008003"
ABresult
0X0
100
111
Truth table0%0/5
A and B and C and D
A= $cb_sk_objectB= @ks == 1C= exists $$cb_sk_object{$ks[0]}D= ref $$cb_sk_object{$ks[0]}
ABCDresult
0XXX0
10XX0
110X0
11100
11111
Truth table0%0/3
A or B
A= @val == 0B= @val > 1
ABresult
1X1
011
000
263 sub join {
264 return '' if (@_ < 2);
265 my $j = shift;
266 my $str = shift;
267 for (@_) { $str .= $j . $_; }
268 return $str;
269 }
270 0 ▶ |}sub JSON::PP::incr_parse {local$Carp::CarpLevel=1;($_[0]->{_incr_parser}||= JSON::PP::IncrParser->new)->incr_parse(@_)}sub JSON::PP::incr_skip {($_[0]->{_incr_parser}||= JSON::PP::IncrParser->new)->incr_skip}sub JSON::PP::incr_reset {($_[0]->{_incr_parser}||= JSON::PP::IncrParser->new)->incr_reset}eval q{
Subroutine incr_parse: not called CC=2 SCAR=16.3
Subroutine incr_reset: not called CC=2 SCAR=16.3
Subroutine incr_skip: not called CC=2 SCAR=16.3
Subroutine incr_text: not called CC=3 SCAR=23.0
Pod documented
Pod documented
Pod documented
Pod documented
Branch: 2 branches
BranchTrueFalseTotal
if $] >= "5.006" 2 0 2
if ($_[0]{"_incr_parser"}{"incr_parsing"}) 0 0 0
Condition0%0/12
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
l!l&&r!l&&!r
000
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
l!l&&r!l&&!r
000
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
l!l&&r!l&&!r
000
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
l!l&&r!l&&!r
000
MC/DC0%0/2
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
$_[0]{"_incr_parser"} "JSON::PP::IncrParser"->new
MC/DC0%0/2
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
$_[0]{"_incr_parser"} "JSON::PP::IncrParser"->new
MC/DC0%0/2
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
$_[0]{"_incr_parser"} "JSON::PP::IncrParser"->new
MC/DC0%0/2
$_[0]{"_incr_parser"} ||= "JSON::PP::IncrParser"->new
$_[0]{"_incr_parser"} "JSON::PP::IncrParser"->new
Truth table0%0/3
A ||= B
A= $_[0]{"_incr_parser"}B= "JSON::PP::IncrParser"->new
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $_[0]{"_incr_parser"}B= "JSON::PP::IncrParser"->new
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $_[0]{"_incr_parser"}B= "JSON::PP::IncrParser"->new
ABresult
1X1
011
000
Truth table0%0/3
A ||= B
A= $_[0]{"_incr_parser"}B= "JSON::PP::IncrParser"->new
ABresult
1X1
011
000
271 sub JSON::PP::incr_text : lvalue {
272 $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new;
273
274 if ( $_[0]->{_incr_parser}->{incr_parsing} ) {
275 Carp::croak("incr_text can not be called when the incremental parser already started parsing");
276 }
277 $_[0]->{_incr_parser}->{incr_text};
278 }
279 0 ▶ } if ($] >= 5.006)}BEGIN {eval 'require Scalar::Util';unless($@){*JSON::PP::blessed=\&Scalar::Util::blessed;*JSON::PP::reftype=\&Scalar::Util::reftype;*JSON::PP::refaddr=\&Scalar::Util::refaddr}else{eval 'sub UNIVERSAL::a_sub_not_likely_to_be_here { ref($_[0]) }';*JSON::PP::blessed=sub {local($@,$SIG{__DIE__},$SIG{__WARN__});ref($_[0])? eval {$_[0]->a_sub_not_likely_to_be_here}: undef};my%tmap=qw(B::NULL SCALAR B::HV HASH B::AV ARRAY B::CV CODE B::IO IO B::GV GLOB B::REGEXP REGEXP);*JSON::PP::reftype=sub {my$r=shift;return undef unless length(ref($r));my$t=ref(B::svref_2object($r));return exists$tmap{$t}? $tmap{$t}: length(ref($$r))? 'REF' : 'SCALAR'};*JSON::PP::refaddr=sub {return undef unless length(ref($_[0]));my$addr;if(defined(my$pkg=blessed($_[0]))){$addr .= bless $_[0],'Scalar::Util::Fake';bless $_[0],$pkg}else {$addr .= $_[0]}$addr =~ /0x(\w+)/;local $^W;hex($1)}}}$JSON::PP::true=do {bless \(my$dummy=1),"JSON::PP::Boolean"};$JSON::PP::false=do {bless \(my$dummy=0),"JSON::PP::Boolean"};sub is_bool {defined $_[0]and UNIVERSAL::isa($_[0],"JSON::PP::Boolean")}sub true {$JSON::PP::true}sub false {$JSON::PP::false}sub null {undef}package JSON::PP::Boolean;use overload ("0+"=>sub {${$_[0]}},"++"=>sub {$_[0]=${$_[0]}+ 1},"--"=>sub {$_[0]=${$_[0]}- 1},fallback=>1,);package JSON::PP::IncrParser;use strict;use constant INCR_M_WS=>0;use constant INCR_M_STR=>1;use constant INCR_M_BS=>2;use constant INCR_M_JSON=>3;use constant INCR_M_C0=>4;use constant INCR_M_C1=>5;$JSON::PP::IncrParser::VERSION='1.01';my$unpack_format=$] < 5.006 ? 'C*' : 'U*';sub new {my ($class)=@_;bless {incr_nest=>0,incr_text=>undef,incr_parsing=>0,incr_p=>0,},$class}sub incr_parse {my ($self,$coder,$text)=@_;$self->{incr_text}='' unless (defined$self->{incr_text});if (defined$text){if (utf8::is_utf8($text)and!utf8::is_utf8($self->{incr_text})){utf8::upgrade($self->{incr_text});utf8::decode($self->{incr_text})}$self->{incr_text}.= $text}my$max_size=$coder->get_max_size;if (defined wantarray){$self->{incr_mode}=INCR_M_WS unless defined$self->{incr_mode};if (wantarray){my@ret;$self->{incr_parsing}=1;do {push@ret,$self->_incr_parse($coder,$self->{incr_text});unless (!$self->{incr_nest}and $self->{incr_mode}==INCR_M_JSON){$self->{incr_mode}=INCR_M_WS if$self->{incr_mode}!=INCR_M_STR}}until (length$self->{incr_text}>= $self->{incr_p});$self->{incr_parsing}=0;return@ret}else {$self->{incr_parsing}=1;my$obj=$self->_incr_parse($coder,$self->{incr_text});$self->{incr_parsing}=0 if defined$obj;return$obj ? $obj : undef}}}sub _incr_parse {my ($self,$coder,$text,$skip)=@_;my$p=$self->{incr_p};my$restore=$p;my@obj;my$len=length$text;if ($self->{incr_mode}==INCR_M_WS){while ($len > $p){my$s=substr($text,$p,1);$p++ and next if (0x20 >= unpack($unpack_format,$s));$self->{incr_mode}=INCR_M_JSON;last}}while ($len > $p){my$s=substr($text,$p++,1);if ($s eq '"'){if (substr($text,$p - 2,1)eq '\\'){next}if ($self->{incr_mode}!=INCR_M_STR){$self->{incr_mode}=INCR_M_STR}else {$self->{incr_mode}=INCR_M_JSON;unless ($self->{incr_nest}){last}}}if ($self->{incr_mode}==INCR_M_JSON){if ($s eq '[' or $s eq '{'){if (++$self->{incr_nest}> $coder->get_max_depth){Carp::croak('json text or perl structure exceeds maximum nesting level (max_depth set too low?)')}}elsif ($s eq ']' or $s eq '}'){last if (--$self->{incr_nest}<= 0)}elsif ($s eq '#'){while ($len > $p){last if substr($text,$p++,1)eq "\n"}}}}$self->{incr_p}=$p;return if ($self->{incr_mode}==INCR_M_STR and not $self->{incr_nest});return if ($self->{incr_mode}==INCR_M_JSON and $self->{incr_nest}> 0);return '' unless (length substr($self->{incr_text},0,$p));local$Carp::CarpLevel=2;$self->{incr_p}=$restore;$self->{incr_c}=$p;my ($obj,$tail)=$coder->PP_decode_json(substr($self->{incr_text},0,$p),0x10000001);$self->{incr_text}=substr($self->{incr_text},$p);$self->{incr_p}=0;return$obj || ''}sub incr_text {if ($_[0]->{incr_parsing}){Carp::croak("incr_text can not be called when the incremental parser already started parsing")}$_[0]->{incr_text}}sub incr_skip {my$self=shift;$self->{incr_text}=substr($self->{incr_text},$self->{incr_c});$self->{incr_p}=0}sub incr_reset {my$self=shift;$self->{incr_text}=undef;$self->{incr_p}=0;$self->{incr_mode}=0;$self->{incr_nest}=0;$self->{incr_parsing}=0}1;
Subroutine BEGIN: called CC=2 SCAR=14.9
Subroutine BEGIN: called CC=1 SCAR=4.7
Subroutine BEGIN: called CC=1 SCAR=4.7
Subroutine BEGIN: called CC=1 SCAR=4.7
Subroutine BEGIN: called CC=1 SCAR=4.7
Subroutine BEGIN: called CC=1 SCAR=4.7
Subroutine BEGIN: called CC=1 SCAR=4.7
Subroutine BEGIN: called CC=1 SCAR=4.7
Subroutine BEGIN: called CC=1 SCAR=4.7
Subroutine __ANON__: not called CC=2 SCAR=14.9
Subroutine __ANON__: not called CC=4 SCAR=26.2
Subroutine __ANON__: not called CC=3 SCAR=21.4
Subroutine __ANON__: not called CC=1 SCAR=4.7
Subroutine __ANON__: not called CC=1 SCAR=4.7
Subroutine __ANON__: not called CC=1 SCAR=4.7
Subroutine _incr_parse: not called CC=26 SCAR=60.8
Subroutine false: not called CC=1 SCAR=4.7
Subroutine incr_parse: not called CC=14 SCAR=48.9
Subroutine incr_reset: not called CC=1 SCAR=4.7
Subroutine incr_skip: not called CC=1 SCAR=4.7
Subroutine incr_text: not called CC=2 SCAR=14.9
Subroutine is_bool: not called CC=2 SCAR=14.9
Subroutine new: not called CC=1 SCAR=4.7
Subroutine null: not called CC=1 SCAR=4.7
Subroutine true: not called CC=1 SCAR=4.7
Pod documented
Pod documented
Pod documented
Pod documented
Branch: 40 branches
BranchTrueFalseTotal
if ($@) { } 0 2 2
ref $_[0] ? : 0 0 0
unless length ref $r 0 0 0
exists $tmap{$t} ? : 0 0 0
length ref $$r ? : 0 0 0
unless length ref $_[0] 0 0 0
if (defined(my $pkg = &blessed($_[0]))) { } 0 0 0
if ($self->{"incr_mode"} == 0) 0 0 0
if ($len > $p) 0 0 0
if 32 >= unpack($unpack_format, $s) 0 0 0
if ($len > $p) 0 0 0
if ($s eq "\"") 0 0 0
if (substr($text, $p - 2, 1) eq "\\") 0 0 0
if ($self->{'incr_mode'} != 1) { } 0 0 0
unless ($self->{"incr_nest"}) 0 0 0
if ($self->{"incr_mode"} == 3) 0 0 0
if ($s eq '[' or $s eq '{') { } 0 0 0
elsif ($s eq ']' or $s eq '}') { } 0 0 0
elsif ($s eq '#') { } 0 0 0
if (++$self->{"incr_nest"} > $coder->get_max_depth) 0 0 0
if --$self->{"incr_nest"} <= 0 0 0 0
if ($len > $p) 0 0 0
if substr($text, $p++, 1) eq "\n" 0 0 0
if $self->{"incr_mode"} == 1 and not $self->{"incr_nest"} 0 0 0
if $self->{"incr_mode"} == 3 and $self->{"incr_nest"} > 0 0 0 0
unless length substr($self->{"incr_text"}, 0, $p) 0 0 0
unless defined $self->{"incr_text"} 0 0 0
if (defined $text) 0 0 0
if (utf8::is_utf8($text) and not utf8::is_utf8($self->{"incr_text"})) 0 0 0
if (defined wantarray) 0 0 0
unless defined $self->{"incr_mode"} 0 0 0
if (wantarray) { } 0 0 0
length $self->{"incr_text"} >= $self->{"incr_p"} or do { do { push @ret, $self->_incr_parse($coder, $self->{"incr_text"}); unless (not $self->{"incr_nest"} and $self->{"incr_mode"} == 3) { $self->{"incr_mode"} = 0 if $self->{"incr_mode"} != 1; } } } 0 0 0
unless (not $self->{"incr_nest"} and $self->{"incr_mode"} == 3) 0 0 0
if $self->{"incr_mode"} != 1 0 0 0
if defined $obj 0 0 0
$obj ? : 0 0 0
if ($_[0]{"incr_parsing"}) 0 0 0
defined $_[0] and UNIVERSAL::isa($_[0], "JSON::PP::Boolean") 0 0 0
$] < 5.006 ? : 0 2 2
Condition0%0/25
32 >= unpack($unpack_format, $s) && ($p++ && (next))
!ll&&!rl&&r
000
$p++ and next
!ll
00
$s eq "[" or $s eq "{"
l!l&&r!l&&!r
000
$s eq "]" or $s eq "}"
l!l&&r!l&&!r
000
$self->{"incr_mode"} == 1 and not $self->{"incr_nest"}
!ll&&!rl&&r
000
$self->{"incr_mode"} == 3 and $self->{"incr_nest"} > 0
!ll&&!rl&&r
000
$obj || ''
l!l
00
utf8::is_utf8($text) and not utf8::is_utf8($self->{"incr_text"})
!ll&&!rl&&r
000
not $self->{"incr_nest"} and $self->{"incr_mode"} == 3
!ll&&!rl&&r
000
MC/DC0%0/2
32 >= unpack($unpack_format, $s) && ($p++ && (next))
32 >= unpack($unpack_format, $s) $p++
MC/DC0%0/2
$s eq "[" or $s eq "{"
$s eq "[" $s eq "{"
MC/DC0%0/2
$s eq "]" or $s eq "}"
$s eq "]" $s eq "}"
MC/DC0%0/2
$self->{"incr_mode"} == 1 and not $self->{"incr_nest"}
$self->{"incr_mode"} == 1 not $self->{"incr_nest"}
MC/DC0%0/2
$self->{"incr_mode"} == 3 and $self->{"incr_nest"} > 0
$self->{"incr_mode"} == 3 $self->{"incr_nest"} > 0
MC/DC0%0/1
$obj || ''
$obj
MC/DC0%0/2
utf8::is_utf8($text) and not utf8::is_utf8($self->{"incr_text"})
utf8::is_utf8($text) not utf8::is_utf8($self->{"incr_text"})
MC/DC0%0/2
not $self->{"incr_nest"} and $self->{"incr_mode"} == 3
not $self->{"incr_nest"} $self->{"incr_mode"} == 3
Truth table0%0/3
A && B
A= 32 >= unpack($unpack_format, $s)B= $p++
ABresult
0X0
100
111
Truth table0%0/3
A or B
A= $s eq "["B= $s eq "{"
ABresult
1X1
011
000
Truth table0%0/3
A or B
A= $s eq "]"B= $s eq "}"
ABresult
1X1
011
000
Truth table0%0/3
A and not(B)
A= $self->{"incr_mode"} == 1B= not $self->{"incr_nest"}
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $self->{"incr_mode"} == 3B= $self->{"incr_nest"} > 0
ABresult
0X0
100
111
Truth table0%0/2
A
A= $obj
Aresult
11
00
Truth table0%0/3
A and not(B)
A= utf8::is_utf8($text)B= not utf8::is_utf8($self->{"incr_text"})
ABresult
0X0
100
111
Truth table0%0/3
not(A) and B
A= not $self->{"incr_nest"}B= $self->{"incr_mode"} == 3
ABresult
0X0
100
111
280 JSON_PP
281  
282 2 $fatpacked{"JSON/PP/Boolean.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'JSON_PP_BOOLEAN';
283 use JSON::PP ();use strict;1;
284 JSON_PP_BOOLEAN
285  
286 2 $fatpacked{"Module/CPANfile.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'MODULE_CPANFILE';
287 package Module::CPANfile;use strict;use warnings;use Cwd;use Carp ();use Module::CPANfile::Environment;use Module::CPANfile::Requirement;our$VERSION='1.1000';sub new {my($class,$file)=@_;bless {},$class}sub load {my($proto,$file)=@_;my$self=ref$proto ? $proto : $proto->new;$self->parse($file || Cwd::abs_path('cpanfile'));$self}sub save {my($self,$path)=@_;open my$out,">",$path or die "$path: $!";print {$out}$self->to_string}sub parse {my($self,$file)=@_;my$code=do {open my$fh,"<",$file or die "$file: $!";join '',<$fh>};my$env=Module::CPANfile::Environment->new($file);$env->parse($code)or die $@;$self->{_mirrors}=$env->mirrors;$self->{_prereqs}=$env->prereqs}sub from_prereqs {my($proto,$prereqs)=@_;my$self=$proto->new;$self->{_prereqs}=Module::CPANfile::Prereqs->from_cpan_meta($prereqs);$self}sub mirrors {my$self=shift;$self->{_mirrors}|| []}sub features {my$self=shift;map$self->feature($_),$self->{_prereqs}->identifiers}sub feature {my($self,$identifier)=@_;$self->{_prereqs}->feature($identifier)}sub prereq {shift->prereqs}sub prereqs {my$self=shift;$self->{_prereqs}->as_cpan_meta}sub merged_requirements {my$self=shift;$self->{_prereqs}->merged_requirements}sub effective_prereqs {my($self,$features)=@_;$self->prereqs_with(@{$features || []})}sub prereqs_with {my($self,@feature_identifiers)=@_;my$prereqs=$self->prereqs;my@others=map {$self->feature($_)->prereqs}@feature_identifiers;$prereqs->with_merged_prereqs(\@others)}sub prereq_specs {my$self=shift;$self->prereqs->as_string_hash}sub prereq_for_module {my($self,$module)=@_;$self->{_prereqs}->find($module)}sub options_for_module {my($self,$module)=@_;my$prereq=$self->prereq_for_module($module)or return;$prereq->requirement->options}sub merge_meta {my($self,$file,$version)=@_;require CPAN::Meta;$version ||= $file =~ /\.yml$/ ? '1.4' : '2';my$prereq=$self->prereqs;my$meta=CPAN::Meta->load_file($file);my$prereqs_hash=$prereq->with_merged_prereqs($meta->effective_prereqs)->as_string_hash;my$struct={%{$meta->as_struct},prereqs=>$prereqs_hash };CPAN::Meta->new($struct)->save($file,{version=>$version })}sub _dump {my$str=shift;require Data::Dumper;chomp(my$value=Data::Dumper->new([$str])->Terse(1)->Dump);$value}sub to_string {my($self,$include_empty)=@_;my$mirrors=$self->mirrors;my$prereqs=$self->prereq_specs;my$code='';$code .= $self->_dump_mirrors($mirrors);$code .= $self->_dump_prereqs($prereqs,$include_empty);for my$feature ($self->features){$code .= sprintf "feature %s, %s => sub {\n",_dump($feature->{identifier}),_dump($feature->{description});$code .= $self->_dump_prereqs($feature->{spec},$include_empty,4);$code .= "}\n\n"}$code =~ s/\n+$/\n/s;$code}sub _dump_mirrors {my($self,$mirrors)=@_;my$code="";for my$url (@$mirrors){$code .= "mirror '$url';\n"}$code =~ s/\n+$/\n/s;$code}sub _dump_prereqs {my($self,$prereqs,$include_empty,$base_indent)=@_;my$code='';for my$phase (qw(runtime configure build test develop)){my$indent=$phase eq 'runtime' ? '' : ' ';$indent=(' ' x ($base_indent || 0)).$indent;my($phase_code,$requirements);$phase_code .= "on $phase => sub {\n" unless$phase eq 'runtime';for my$type (qw(requires recommends suggests conflicts)){for my$mod (sort keys %{$prereqs->{$phase}{$type}}){my$ver=$prereqs->{$phase}{$type}{$mod};$phase_code .= $ver eq '0' ? "${indent}$type '$mod';\n" : "${indent}$type '$mod', '$ver';\n";$requirements++}}$phase_code .= "\n" unless$requirements;$phase_code .= "};\n" unless$phase eq 'runtime';$code .= $phase_code ."\n" if$requirements or $include_empty}$code =~ s/\n+$/\n/s;$code}1;
288 MODULE_CPANFILE
289  
290 2 $fatpacked{"Module/CPANfile/Environment.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'MODULE_CPANFILE_ENVIRONMENT';
291 package Module::CPANfile::Environment;use strict;use warnings;use Module::CPANfile::Prereqs;use Carp ();my@bindings=qw(on requires recommends suggests conflicts feature osname mirror configure_requires build_requires test_requires author_requires);my$file_id=1;sub new {my($class,$file)=@_;bless {file=>$file,phase=>'runtime',feature=>undef,features=>{},prereqs=>Module::CPANfile::Prereqs->new,mirrors=>[],},$class}sub bind {my$self=shift;my$pkg=caller;for my$binding (@bindings){no strict 'refs';*{"$pkg\::$binding"}=sub {$self->$binding(@_)}}}sub parse {my($self,$code)=@_;my$err;{local $@;$file_id++;$self->_evaluate(<<EVAL);$err=$@}if ($err){die "Parsing $self->{file} failed: $err"};return 1}sub _evaluate {my$_environment=$_[0];eval $_[1]}sub prereqs {$_[0]->{prereqs}}sub mirrors {$_[0]->{mirrors}}sub on {my($self,$phase,$code)=@_;local$self->{phase}=$phase;$code->()}sub feature {my($self,$identifier,$description,$code)=@_;if (@_==3 && ref($description)eq 'CODE'){$code=$description;$description=$identifier}unless (ref$description eq '' && ref$code eq 'CODE'){Carp::croak("Usage: feature 'identifier', 'Description' => sub { ... }")}local$self->{feature}=$identifier;$self->prereqs->add_feature($identifier,$description);$code->()}sub osname {die "TODO"}sub mirror {my($self,$url)=@_;push @{$self->{mirrors}},$url}sub requirement_for {my($self,$module,@args)=@_;my$requirement=0;$requirement=shift@args if@args % 2;return Module::CPANfile::Requirement->new(name=>$module,version=>$requirement,@args,)}sub requires {my$self=shift;$self->add_prereq(requires=>@_)}sub recommends {my$self=shift;$self->add_prereq(recommends=>@_)}sub suggests {my$self=shift;$self->add_prereq(suggests=>@_)}sub conflicts {my$self=shift;$self->add_prereq(conflicts=>@_)}sub add_prereq {my($self,$type,$module,@args)=@_;$self->prereqs->add_prereq(feature=>$self->{feature},phase=>$self->{phase},type=>$type,module=>$module,requirement=>$self->requirement_for($module,@args),)}sub configure_requires {my($self,@args)=@_;$self->on(configure=>sub {$self->requires(@args)})}sub build_requires {my($self,@args)=@_;$self->on(build=>sub {$self->requires(@args)})}sub test_requires {my($self,@args)=@_;$self->on(test=>sub {$self->requires(@args)})}sub author_requires {my($self,@args)=@_;$self->on(develop=>sub {$self->requires(@args)})}1;
292 package Module::CPANfile::Sandbox$file_id;
293 no warnings;
294 BEGIN { \$_environment->bind }
295
296 # line 1 "$self->{file}"
297 $code;
298 EVAL
299 MODULE_CPANFILE_ENVIRONMENT
300  
301 2 $fatpacked{"Module/CPANfile/Prereq.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'MODULE_CPANFILE_PREREQ';
302 package Module::CPANfile::Prereq;use strict;sub new {my($class,%options)=@_;bless \%options,$class}sub feature {$_[0]->{feature}}sub phase {$_[0]->{phase}}sub type {$_[0]->{type}}sub module {$_[0]->{module}}sub requirement {$_[0]->{requirement}}sub match_feature {my($self,$identifier)=@_;no warnings 'uninitialized';$self->feature eq $identifier}1;
303 MODULE_CPANFILE_PREREQ
304  
305 2 $fatpacked{"Module/CPANfile/Prereqs.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'MODULE_CPANFILE_PREREQS';
306 package Module::CPANfile::Prereqs;use strict;use Carp ();use CPAN::Meta::Feature;use Module::CPANfile::Prereq;sub from_cpan_meta {my($class,$prereqs)=@_;my$self=$class->new;for my$phase (keys %$prereqs){for my$type (keys %{$prereqs->{$phase}}){while (my($module,$requirement)=each %{$prereqs->{$phase}{$type}}){$self->add_prereq(phase=>$phase,type=>$type,module=>$module,requirement=>Module::CPANfile::Requirement->new(name=>$module,version=>$requirement),)}}}$self}sub new {my$class=shift;bless {prereqs=>[],features=>{},},$class}sub add_feature {my($self,$identifier,$description)=@_;$self->{features}{$identifier}={description=>$description }}sub add_prereq {my($self,%args)=@_;$self->add(Module::CPANfile::Prereq->new(%args))}sub add {my($self,$prereq)=@_;push @{$self->{prereqs}},$prereq}sub as_cpan_meta {my$self=shift;$self->{cpanmeta}||= $self->build_cpan_meta}sub build_cpan_meta {my($self,$identifier)=@_;my$prereq_spec={};$self->prereq_each($identifier,sub {my$prereq=shift;$prereq_spec->{$prereq->phase}{$prereq->type}{$prereq->module}=$prereq->requirement->version});CPAN::Meta::Prereqs->new($prereq_spec)}sub prereq_each {my($self,$identifier,$code)=@_;for my$prereq (@{$self->{prereqs}}){next unless$prereq->match_feature($identifier);$code->($prereq)}}sub merged_requirements {my$self=shift;my$reqs=CPAN::Meta::Requirements->new;for my$prereq (@{$self->{prereqs}}){$reqs->add_string_requirement($prereq->module,$prereq->requirement->version)}$reqs}sub find {my($self,$module)=@_;for my$prereq (@{$self->{prereqs}}){return$prereq if$prereq->module eq $module}return}sub identifiers {my$self=shift;keys %{$self->{features}}}sub feature {my($self,$identifier)=@_;my$data=$self->{features}{$identifier}or Carp::croak("Unknown feature '$identifier'");my$prereqs=$self->build_cpan_meta($identifier);CPAN::Meta::Feature->new($identifier,{description=>$data->{description},prereqs=>$prereqs->as_string_hash,})}1;
307 MODULE_CPANFILE_PREREQS
308  
309 2 $fatpacked{"Module/CPANfile/Requirement.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'MODULE_CPANFILE_REQUIREMENT';
310 package Module::CPANfile::Requirement;use strict;sub new {my ($class,%args)=@_;$args{version}||= 0;bless +{name=>delete$args{name},version=>delete$args{version},options=>\%args,},$class}sub name {$_[0]->{name}}sub version {$_[0]->{version}}sub options {$_[0]->{options}}sub has_options {keys %{$_[0]->{options}}> 0}1;
311 MODULE_CPANFILE_REQUIREMENT
312  
313 2 $fatpacked{"Module/Metadata.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'MODULE_METADATA';
314 package Module::Metadata;sub __clean_eval {eval $_[0]}use strict;use warnings;our$VERSION='1.000038';use Carp qw/croak/;use File::Spec;BEGIN {eval {require Fcntl;Fcntl->import('SEEK_SET');1}or *SEEK_SET=sub {0}}use version 0.87;BEGIN {if ($INC{'Log/Contextual.pm'}){require "Log/Contextual/WarnLogger.pm";Log::Contextual->import('log_info','-default_logger'=>Log::Contextual::WarnLogger->new({env_prefix=>'MODULE_METADATA',}),)}else {*log_info=sub (&) {warn $_[0]->()}}}use File::Find qw(find);my$V_NUM_REGEXP=qr{v?[0-9._]+};my$PKG_FIRST_WORD_REGEXP=qr{ # the FIRST word in a package name
315 [a-zA-Z_] # the first word CANNOT start with a digit
316 (?:
317 [\w']? # can contain letters, digits, _, or ticks
318 \w # But, NO multi-ticks or trailing ticks
319 )*
320 }x;my$PKG_ADDL_WORD_REGEXP=qr{ # the 2nd+ word in a package name
321 \w # the 2nd+ word CAN start with digits
322 (?:
323 [\w']? # and can contain letters or ticks
324 \w # But, NO multi-ticks or trailing ticks
325 )*
326 }x;my$PKG_NAME_REGEXP=qr{ # match a package name
327 (?: :: )? # a pkg name can start with arisdottle
328 $PKG_FIRST_WORD_REGEXP # a package word
329 (?:
330 (?: :: )+ ### arisdottle (allow one or many times)
331 $PKG_ADDL_WORD_REGEXP ### a package word
332 )* # ^ zero, one or many times
333 (?:
334 :: # allow trailing arisdottle
335 )?
336 }x;my$PKG_REGEXP=qr{ # match a package declaration
337 ^[\s\{;]* # intro chars on a line
338 package # the word 'package'
339 \s+ # whitespace
340 ($PKG_NAME_REGEXP) # a package name
341 \s* # optional whitespace
342 ($V_NUM_REGEXP)? # optional version number
343 \s* # optional whitespace
344 [;\{] # semicolon line terminator or block start (since 5.16)
345 }x;my$CLASS_REGEXP=qr{ # match a class declaration (core since 5.38)
346 ^[\s\{;]* # intro chars on a line
347 class # the word 'class'
348 \s+ # whitespace
349 ($PKG_NAME_REGEXP) # a package name
350 \s* # optional whitespace
351 ($V_NUM_REGEXP)? # optional version number
352 \s* # optional whitespace
353 [;\{] # semicolon line terminator or block start
354 }x;my$VARNAME_REGEXP=qr{ # match fully-qualified VERSION name
355 ([\$*]) # sigil - $ or *
356 (
357 ( # optional leading package name
358 (?:::|\')? # possibly starting like just :: (a la $::VERSION)
359 (?:\w+(?:::|\'))* # Foo::Bar:: ...
360 )?
361 VERSION
362 )\b
363 }x;my$VERS_REGEXP=qr{ # match a VERSION definition
364 (?:
365 \(\s*$VARNAME_REGEXP\s*\) # with parens
366 |
367 $VARNAME_REGEXP # without parens
368 )
369 \s*
370 =[^=~>] # = but not ==, nor =~, nor =>
371 }x;sub new_from_file {my$class=shift;my$filename=File::Spec->rel2abs(shift);return undef unless defined($filename)&& -f $filename;return$class->_init(undef,$filename,@_)}sub new_from_handle {my$class=shift;my$handle=shift;my$filename=shift;return undef unless defined($handle)&& defined($filename);$filename=File::Spec->rel2abs($filename);return$class->_init(undef,$filename,@_,handle=>$handle)}sub new_from_module {my$class=shift;my$module=shift;my%props=@_;$props{inc}||= \@INC;my$filename=$class->find_module_by_name($module,$props{inc});return undef unless defined($filename)&& -f $filename;return$class->_init($module,$filename,%props)}{my$compare_versions=sub {my ($v1,$op,$v2)=@_;$v1=version->new($v1)unless UNIVERSAL::isa($v1,'version');my$eval_str="\$v1 $op \$v2";my$result=eval$eval_str;log_info {"error comparing versions: '$eval_str' $@"}if $@;return$result};my$normalize_version=sub {my ($version)=@_;if ($version =~ /[=<>!,]/){}elsif (ref$version eq 'version'){$version=$version->is_qv ? $version->normal : $version->stringify}elsif ($version =~ /^[^v][^.]*\.[^.]+\./){$version="v$version"}else {}return$version};my$resolve_module_versions=sub {my$packages=shift;my($file,$version);my$err='';for my$p (@$packages){if (defined($p->{version})){if (defined($version)){if ($compare_versions->($version,'!=',$p->{version})){$err .= " $p->{file} ($p->{version})\n"}else {}}else {$file=$p->{file};$version=$p->{version}}}$file ||= $p->{file}if defined($p->{file})}if ($err){$err=" $file ($version)\n" .$err}my%result=(file=>$file,version=>$version,err=>$err);return \%result};sub provides {my$class=shift;croak "provides() requires key/value pairs \n" if @_ % 2;my%args=@_;croak "provides() takes only one of 'dir' or 'files'\n" if$args{dir}&& $args{files};croak "provides() requires a 'version' argument" unless defined$args{version};croak "provides() does not support version '$args{version}' metadata" unless grep$args{version}eq $_,qw/1.4 2/;$args{prefix}='lib' unless defined$args{prefix};my$p;if ($args{dir}){$p=$class->package_versions_from_directory($args{dir})}else {croak "provides() requires 'files' to be an array reference\n" unless ref$args{files}eq 'ARRAY';$p=$class->package_versions_from_directory($args{files})}if (length$args{prefix}){$args{prefix}=~ s{/$}{};for my$v (values %$p){$v->{file}="$args{prefix}/$v->{file}"}}return$p}sub package_versions_from_directory {my ($class,$dir,$files)=@_;my@files;if ($files){@files=@$files}else {find({wanted=>sub {push@files,$_ if -f $_ && /\.pm$/},no_chdir=>1,},$dir)}my(%prime,%alt);for my$file (@files){my$mapped_filename=File::Spec->abs2rel($file,$dir);my@path=File::Spec->splitdir($mapped_filename);(my$prime_package=join('::',@path))=~ s/\.pm$//;my$pm_info=$class->new_from_file($file);for my$package ($pm_info->packages_inside){next if$package eq 'main';next if$package eq 'DB';next if grep /^_/,split(/::/,$package);my$version=$pm_info->version($package);$prime_package=$package if lc($prime_package)eq lc($package);if ($package eq $prime_package){if (exists($prime{$package})){croak "Unexpected conflict in '$package'; multiple versions found.\n"}else {$mapped_filename="$package.pm" if lc("$package.pm")eq lc($mapped_filename);$prime{$package}{file}=$mapped_filename;$prime{$package}{version}=$version if defined($version)}}else {push(@{$alt{$package}},{file=>$mapped_filename,version=>$version,})}}}for my$package (keys(%alt)){my$result=$resolve_module_versions->($alt{$package});if (exists($prime{$package})){if ($result->{err}){log_info {"Found conflicting versions for package '$package'\n" ." $prime{$package}{file} ($prime{$package}{version})\n" .$result->{err}}}elsif (defined($result->{version})){if (exists($prime{$package}{version})&& defined($prime{$package}{version})){if ($compare_versions->($prime{$package}{version},'!=',$result->{version})){log_info {"Found conflicting versions for package '$package'\n" ." $prime{$package}{file} ($prime{$package}{version})\n" ." $result->{file} ($result->{version})\n"}}}else {$prime{$package}{file}=$result->{file};$prime{$package}{version}=$result->{version}}}else {}}else {if ($result->{err}){log_info {"Found conflicting versions for package '$package'\n" .$result->{err}}}$prime{$package}{file}=$result->{file};$prime{$package}{version}=$result->{version}if defined($result->{version})}}for (grep defined $_->{version},values%prime){$_->{version}=$normalize_version->($_->{version})}return \%prime}}sub _init {my$class=shift;my$module=shift;my$filename=shift;my%props=@_;my$handle=delete$props{handle};my(%valid_props,@valid_props);@valid_props=qw(collect_pod inc decode_pod);@valid_props{@valid_props}=delete(@props{@valid_props});warn "Unknown properties: @{[keys %props]}\n" if scalar(%props);my%data=(module=>$module,filename=>$filename,version=>undef,packages=>[],versions=>{},pod=>{},pod_headings=>[],collect_pod=>0,%valid_props,);my$self=bless(\%data,$class);if (not $handle){my$filename=$self->{filename};open$handle,'<',$filename or croak("Can't open '$filename': $!");$self->_handle_bom($handle,$filename)}$self->_parse_fh($handle);@{$self->{packages}}=__uniq(@{$self->{packages}});unless($self->{module}and length($self->{module})){if ($self->{filename}=~ /\.pm$/){my ($v,$d,$f)=File::Spec->splitpath($self->{filename});$f =~ s/\..+$//;my@candidates=grep /(^|::)$f$/,@{$self->{packages}};$self->{module}=shift(@candidates)}else {if ((grep /main/,@{$self->{packages}})or (grep /main/,keys %{$self->{versions}})){$self->{module}='main'}else {$self->{module}=$self->{packages}[0]|| ''}}}$self->{version}=$self->{versions}{$self->{module}}if defined($self->{module});return$self}sub _do_find_module {my$class=shift;my$module=shift || croak 'find_module_by_name() requires a package name';my$dirs=shift || \@INC;my$file=File::Spec->catfile(split(/::/,$module));for my$dir (@$dirs){my$testfile=File::Spec->catfile($dir,$file);return [File::Spec->rel2abs($testfile),$dir ]if -e $testfile and!-d _;$testfile .= '.pm';return [File::Spec->rel2abs($testfile),$dir ]if -e $testfile}return}sub find_module_by_name {my$found=shift()->_do_find_module(@_)or return;return$found->[0]}sub find_module_dir_by_name {my$found=shift()->_do_find_module(@_)or return;return$found->[1]}sub _parse_version_expression {my$self=shift;my$line=shift;my($sigil,$variable_name,$package);if ($line =~ /$VERS_REGEXP/o){($sigil,$variable_name,$package)=$2 ? ($1,$2,$3): ($4,$5,$6);if ($package){$package=($package eq '::')? 'main' : $package;$package =~ s/::$//}}return ($sigil,$variable_name,$package)}sub _handle_bom {my ($self,$fh,$filename)=@_;my$pos=tell$fh;return unless defined$pos;my$buf=' ' x 2;my$count=read$fh,$buf,length$buf;return unless defined$count and $count >= 2;my$encoding;if ($buf eq "\x{FE}\x{FF}"){$encoding='UTF-16BE'}elsif ($buf eq "\x{FF}\x{FE}"){$encoding='UTF-16LE'}elsif ($buf eq "\x{EF}\x{BB}"){$buf=' ';$count=read$fh,$buf,length$buf;if (defined$count and $count >= 1 and $buf eq "\x{BF}"){$encoding='UTF-8'}}if (defined$encoding){if ("$]" >= 5.008){binmode($fh,":encoding($encoding)")}}else {seek$fh,$pos,SEEK_SET or croak(sprintf "Can't reset position to the top of '$filename'")}return$encoding}sub _parse_fh {my ($self,$fh)=@_;my($in_pod,$seen_end,$need_vers)=(0,0,0);my(@packages,%vers,%pod,@pod);my$package='main';my$pod_sect='';my$pod_data='';my$in_end=0;my$encoding='';while (defined(my$line=<$fh>)){my$line_num=$.;chomp($line);my$is_cut;if ($line =~ /^=([a-zA-Z].*)/){my$cmd=$1;$is_cut=$cmd =~ /^cut(?:[^a-zA-Z]|$)/;$in_pod=!$is_cut}if ($in_pod){if ($line =~ /^=head[1-4]\s+(.+)\s*$/){push(@pod,$1);if ($self->{collect_pod}&& length($pod_data)){$pod{$pod_sect}=$pod_data;$pod_data=''}$pod_sect=$1}elsif ($self->{collect_pod}){if ($self->{decode_pod}&& $line =~ /^=encoding ([\w-]+)/){$encoding=$1}$pod_data .= "$line\n"}next}elsif ($is_cut){if ($self->{collect_pod}&& length($pod_data)){$pod{$pod_sect}=$pod_data;$pod_data=''}$pod_sect='';next}next if$in_end;next if$line =~ /^\s*#/;if ($line eq '__END__'){$in_end++;next}last if$line eq '__DATA__';my($version_sigil,$version_fullname,$version_package)=index($line,'VERSION')>= 1 ? $self->_parse_version_expression($line): ();if ($line =~ /$PKG_REGEXP/o or $line =~ /$CLASS_REGEXP/){$package=$1;my$version=$2;push(@packages,$package)unless grep($package eq $_,@packages);$need_vers=defined$version ? 0 : 1;if (not exists$vers{$package}and defined$version){my$dwim_version=eval {_dwim_version($version)};croak "Version '$version' from $self->{filename} does not appear to be valid:\n$line\n\nThe fatal error was: $@\n" unless defined$dwim_version;$vers{$package}=$dwim_version}}elsif ($version_fullname && $version_package){$need_vers=0 if$version_package eq $package;unless (defined$vers{$version_package}&& length$vers{$version_package}){$vers{$version_package}=$self->_evaluate_version_line($version_sigil,$version_fullname,$line)}}elsif ($package eq 'main' && $version_fullname &&!exists($vers{main})){$need_vers=0;my$v=$self->_evaluate_version_line($version_sigil,$version_fullname,$line);$vers{$package}=$v;push(@packages,'main')}elsif ($package eq 'main' &&!exists($vers{main})&& $line =~ /\w/){$need_vers=1;$vers{main}='';push(@packages,'main')}elsif ($version_fullname && $need_vers){$need_vers=0;my$v=$self->_evaluate_version_line($version_sigil,$version_fullname,$line);unless (defined$vers{$package}&& length$vers{$package}){$vers{$package}=$v}}}if ($self->{collect_pod}&& length($pod_data)){$pod{$pod_sect}=$pod_data}if ($self->{decode_pod}&& $encoding){require Encode;$_=Encode::decode($encoding,$_)for values%pod}$self->{versions}=\%vers;$self->{packages}=\@packages;$self->{pod}=\%pod;$self->{pod_headings}=\@pod}sub __uniq (@) {my (%seen,$key);grep!$seen{$key=$_ }++,@_}{my$pn=0;sub _evaluate_version_line {my$self=shift;my($sigil,$variable_name,$line)=@_;$pn++;my$eval=qq{ my \$dummy = q# Hide from _packages_inside()
372 #; package Module::Metadata::_version::p${pn};
373 use version;
374 sub {
375 local $sigil$variable_name;
376 $line;
377 return \$$variable_name if defined \$$variable_name;
378 return \$Module::Metadata::_version::p${pn}::$variable_name;
379 };
380 };$eval=$1 if$eval =~ m{^(.+)}s;local $^W;my$vsub=__clean_eval($eval);if ($@ =~ /Can't locate/ && -d 'lib'){local@INC=('lib',@INC);$vsub=__clean_eval($eval)}warn "Error evaling version line '$eval' in $self->{filename}: $@\n" if $@;(ref($vsub)eq 'CODE')or croak "failed to build version sub for $self->{filename}";my$result=eval {$vsub->()};croak "Could not get version from $self->{filename} by executing:\n$eval\n\nThe fatal error was: $@\n" if $@;my$version=eval {_dwim_version($result)};croak "Version '$result' from $self->{filename} does not appear to be valid:\n$eval\n\nThe fatal error was: $@\n" unless defined$version;return$version}}{my@version_prep=(sub {return shift},sub {my$v=shift;$v =~ s{([0-9])[a-z-].*$}{$1}i;return$v},sub {my$v=shift;my$num_dots=()=$v =~ m{(\.)}g;my$num_unders=()=$v =~ m{(_)}g;my$leading_v=substr($v,0,1)eq 'v';if (!$leading_v && $num_dots < 2 && $num_unders > 1){$v =~ s{_}{}g;$num_unders=()=$v =~ m{(_)}g}return$v},sub {my$v=shift;no warnings 'numeric';return 0 + $v},);sub _dwim_version {my ($result)=shift;return$result if ref($result)eq 'version';my ($version,$error);for my$f (@version_prep){$result=$f->($result);$version=eval {version->new($result)};$error ||= $@ if $@;last if defined$version}croak$error unless defined$version;return$version}}sub name {$_[0]->{module}}sub filename {$_[0]->{filename}}sub packages_inside {@{$_[0]->{packages}}}sub pod_inside {@{$_[0]->{pod_headings}}}sub contains_pod {0+@{$_[0]->{pod_headings}}}sub version {my$self=shift;my$mod=shift || $self->{module};my$vers;if (defined($mod)&& length($mod)&& exists($self->{versions}{$mod})){return$self->{versions}{$mod}}else {return undef}}sub pod {my$self=shift;my$sect=shift;if (defined($sect)&& length($sect)&& exists($self->{pod}{$sect})){return$self->{pod}{$sect}}else {return undef}}sub is_indexable {my ($self,$package)=@_;my@indexable_packages=grep $_ ne 'main',$self->packages_inside;return!!grep $_ eq $package,@indexable_packages if$package;return!!@indexable_packages}1;
381 MODULE_METADATA
382  
383 2 $fatpacked{"Parse/CPAN/Meta.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'PARSE_CPAN_META';
384 0 ▶ use 5.008001;use strict;package Parse::CPAN::Meta;our$VERSION='1.4414';use Exporter;use Carp 'croak';our@ISA=qw/Exporter/;our@EXPORT_OK=qw/Load LoadFile/;sub load_file {my ($class,$filename)=@_;my$meta=_slurp($filename);if ($filename =~ /\.ya?ml$/){return$class->load_yaml_string($meta)}elsif ($filename =~ /\.json$/){return$class->load_json_string($meta)}else {$class->load_string($meta)}}sub load_string {my ($class,$string)=@_;if ($string =~ /^---/){return$class->load_yaml_string($string)}elsif ($string =~ /^\s*\{/){return$class->load_json_string($string)}else {return$class->load_yaml_string($string)}}sub load_yaml_string {my ($class,$string)=@_;my$backend=$class->yaml_backend();my$data=eval {no strict 'refs';&{"$backend\::Load"}($string)};croak $@ if $@;return$data || {}}sub load_json_string {my ($class,$string)=@_;my$data=eval {$class->json_backend()->new->decode($string)};croak $@ if $@;return$data || {}}sub yaml_backend {if (!defined$ENV{PERL_YAML_BACKEND}){_can_load('CPAN::Meta::YAML',0.011)or croak "CPAN::Meta::YAML 0.011 is not available\n";return "CPAN::Meta::YAML"}else {my$backend=$ENV{PERL_YAML_BACKEND};_can_load($backend)or croak "Could not load PERL_YAML_BACKEND '$backend'\n";$backend->can("Load")or croak "PERL_YAML_BACKEND '$backend' does not implement Load()\n";return$backend}}sub json_backend {if (!$ENV{PERL_JSON_BACKEND}or $ENV{PERL_JSON_BACKEND}eq 'JSON::PP'){_can_load('JSON::PP'=>2.27103)or croak "JSON::PP 2.27103 is not available\n";return 'JSON::PP'}else {_can_load('JSON'=>2.5)or croak "JSON 2.5 is required for " ."\$ENV{PERL_JSON_BACKEND} = '$ENV{PERL_JSON_BACKEND}'\n";return "JSON"}}sub _slurp {require Encode;open my$fh,"<:raw","$_[0]" or die "can't open $_[0] for reading: $!";my$content=do {local $/;<$fh>};$content=Encode::decode('UTF-8',$content,Encode::PERLQQ());return$content}sub _can_load {my ($module,$version)=@_;(my$file=$module)=~ s{::}{/}g;$file .= ".pm";return 1 if$INC{$file};return 0 if exists$INC{$file};eval {require$file;1}or return 0;if (defined$version){eval {$module->VERSION($version);1}or return 0}return 1}sub LoadFile ($) {return Load(_slurp(shift))}sub Load ($) {require CPAN::Meta::YAML;my$object=eval {CPAN::Meta::YAML::Load(shift)};croak $@ if $@;return$object}1;
Subroutine BEGIN: called CC=1 SCAR=2.2
Subroutine BEGIN: called CC=1 SCAR=2.2
Subroutine BEGIN: called CC=1 SCAR=2.2
Subroutine BEGIN: called CC=1 SCAR=2.2
Subroutine BEGIN: called CC=1 SCAR=2.2
Subroutine Load: not called CC=2 SCAR=10.9
Subroutine LoadFile: not called CC=1 SCAR=2.2
Subroutine _can_load: called CC=6 SCAR=26.9
Subroutine _slurp: not called CC=2 SCAR=10.9
Subroutine json_backend: called CC=5 SCAR=24.0
Subroutine load_file: not called CC=3 SCAR=16.4
Subroutine load_json_string: called CC=3 SCAR=16.4
Subroutine load_string: not called CC=3 SCAR=16.4
Subroutine load_yaml_string: not called CC=3 SCAR=16.4
Subroutine yaml_backend: not called CC=5 SCAR=24.0
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Pod documented
Branch: 20 branches
BranchTrueFalseTotal
if $@ 0 0 0
if $INC{$file} 4 2 6
if exists $INC{$file} 0 2 2
eval { do { require $file; 1 } } or return 0 2 0 2
if (defined $version) 2 0 2
eval { do { $module->VERSION($version); 1 } } or return 0 2 0 2
open my $fh, "<:raw", "$_[0]" or die "can't open $_[0] for reading: $!" 0 0 0
if (not $ENV{'PERL_JSON_BACKEND'} or $ENV{'PERL_JSON_BACKEND'} eq 'JSON::PP') { } 6 0 6
_can_load("JSON::PP", "2.27103") or croak("JSON::PP 2.27103 is not available\n") 6 0 6
_can_load("JSON", "2.5") or croak('JSON 2.5 is required for ' . qq[\$ENV{PERL_JSON_BACKEND} = '$ENV{"PERL_JSON_BACKEND"}'\n]) 0 0 0
if ($filename =~ /\.ya?ml$/) { } 0 0 0
elsif ($filename =~ /\.json$/) { } 0 0 0
if $@ 0 2 2
if ($string =~ /^---/) { } 0 0 0
elsif ($string =~ /^\s*\{/) { } 0 0 0
if $@ 0 0 0
if (not defined $ENV{'PERL_YAML_BACKEND'}) { } 0 0 0
_can_load("CPAN::Meta::YAML", "0.011") or croak("CPAN::Meta::YAML 0.011 is not available\n") 0 0 0
_can_load($backend) or croak("Could not load PERL_YAML_BACKEND '${backend}'\n") 0 0 0
$backend->can("Load") or croak("PERL_YAML_BACKEND '${backend}' does not implement Load()\n") 0 0 0
Condition28%2/7
not $ENV{"PERL_JSON_BACKEND"} or $ENV{"PERL_JSON_BACKEND"} eq "JSON::PP"
l!l&&r!l&&!r
600
$data || {}
l!l
20
$data || {}
l!l
00
MC/DC0%0/2
not $ENV{"PERL_JSON_BACKEND"} or $ENV{"PERL_JSON_BACKEND"} eq "JSON::PP"
not $ENV{"PERL_JSON_BACKEND"} $ENV{"PERL_JSON_BACKEND"} eq "JSON::PP"
MC/DC0%0/1
$data || {}
$data
MC/DC0%0/1
$data || {}
$data
Truth table33%1/3
not(A) or B
A= not $ENV{"PERL_JSON_BACKEND"}B= $ENV{"PERL_JSON_BACKEND"} eq "JSON::PP"
ABresult
1X1
011
000
Truth table50%1/2
A
A= $data
Aresult
11
00
Truth table0%0/2
A
A= $data
Aresult
11
00
385 PARSE_CPAN_META
386  
387 2 $fatpacked{"Parse/PMFile.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'PARSE_PMFILE';
388 package Parse::PMFile;sub __clean_eval {eval $_[0]}use strict;use warnings;use Safe;use JSON::PP ();use Dumpvalue;use version ();use File::Spec ();our$VERSION='0.36';our$VERBOSE=0;our$ALLOW_DEV_VERSION=0;our$FORK=0;our$UNSAFE=$] < 5.010000 ? 1 : 0;sub new {my ($class,$meta,$opts)=@_;bless {%{$opts || {}},META_CONTENT=>$meta},$class}sub parse {my ($self,$pmfile)=@_;$pmfile =~ s|\\|/|g;my($filemtime)=(stat$pmfile)[9];$self->{MTIME}=$filemtime;$self->{PMFILE}=$pmfile;unless ($self->_version_from_meta_ok){my$version;unless (eval {$version=$self->_parse_version;1}){$self->_verbose(1,"error with version in $pmfile: $@");return}$self->{VERSION}=$version;if ($self->{VERSION}=~ /^\{.*\}$/){}elsif ($self->{VERSION}=~ /[_\s]/ &&!$self->{ALLOW_DEV_VERSION}&&!$ALLOW_DEV_VERSION){return}}my($ppp)=$self->_packages_per_pmfile;my@keys_ppp=$self->_filter_ppps(sort keys %$ppp);$self->_verbose(1,"Will check keys_ppp[@keys_ppp]\n");my ($package,%errors);my%checked_in;DBPACK: foreach$package (@keys_ppp){if ($package !~ /^\w[\w\:\']*\w?\z/ || $package !~ /\w\z/ || $package =~ /:/ && $package !~ /::/ || $package =~ /\w:\w/ || $package =~ /:::/){$self->_verbose(1,"Package[$package] did not pass the ultimate sanity check");delete$ppp->{$package};next}if ($self->{USERID}&& $self->{PERMISSIONS}&&!$self->_perm_check($package)){delete$ppp->{$package};next}{my (undef,$module)=split m{/lib/},$self->{PMFILE},2;if ($module){$module =~ s{\.pm\z}{};$module =~ s{/}{::}g;if (lc$module eq lc$package && $module ne $package){$errors{$package}={indexing_warning=>"Capitalization of package ($package) does not match filename!",infile=>$self->{PMFILE},}}}}my$pp=$ppp->{$package};if ($pp->{version}&& $pp->{version}=~ /^\{.*\}$/){my$err=JSON::PP::decode_json($pp->{version});if ($err->{x_normalize}){$errors{$package}={normalize=>$err->{version},infile=>$pp->{infile},};$pp->{version}="undef"}elsif ($err->{openerr}){$pp->{version}="undef";$self->_verbose(1,qq{Parse::PMFile was not able to
389 read the file. It issued the following error: C< $err->{r} >},);$errors{$package}={open=>$err->{r},infile=>$pp->{infile},}}else {$pp->{version}="undef";$self->_verbose(1,qq{Parse::PMFile was not able to
390 parse the following line in that file: C< $err->{line} >
391
392 Note: the indexer is running in a Safe compartement and cannot
393 provide the full functionality of perl in the VERSION line. It
394 is trying hard, but sometime it fails. As a workaround, please
395 consider writing a META.yml that contains a 'provides'
396 attribute or contact the CPAN admins to investigate (yet
397 another) workaround against "Safe" limitations.)},);$errors{$package}={parse_version=>$err->{line},infile=>$err->{file},}}}for ($package,$pp->{version},){if (!defined || /^\s*$/ || /\s/){delete$ppp->{$package};next}}$checked_in{$package}=$ppp->{$package}}return (wantarray && %errors)? (\%checked_in,\%errors): \%checked_in}sub _perm_check {my ($self,$package)=@_;my$userid=$self->{USERID};my$module=$self->{PERMISSIONS}->module_permissions($package);return 1 if!$module;return 1 if defined$module->m && $module->m eq $userid;return 1 if defined$module->f && $module->f eq $userid;return 1 if defined$module->c && grep {$_ eq $userid}@{$module->c};return}sub _parse_version {my$self=shift;use strict;my$pmfile=$self->{PMFILE};my$tmpfile=File::Spec->catfile(File::Spec->tmpdir,"ParsePMFile$$" .rand(1000));my$pmcp=$pmfile;for ($pmcp){s/([^\\](\\\\)*)@/$1\\@/g}my($v);{package main;my$pid;if ($self->{FORK}|| $FORK){$pid=fork();die "Can't fork: $!" unless defined$pid}if ($pid){waitpid($pid,0);if (open my$fh,'<',$tmpfile){$v=<$fh>}}else {my($comp)=Safe->new;my$eval=qq{
398 local(\$^W) = 0;
399 Parse::PMFile::_parse_version_safely("$pmcp");
400 };$comp->permit("entereval");$comp->share("*Parse::PMFile::_parse_version_safely");$comp->share("*version::new");$comp->share("*version::numify");$comp->share_from('main',['*version::','*charstar::','*Exporter::','*DynaLoader::']);$comp->share_from('version',['&qv']);$comp->permit(":base_math");$comp->deny(qw/enteriter iter unstack goto/);version->import('qv')if$self->{UNSAFE}|| $UNSAFE;{no strict;$v=($self->{UNSAFE}|| $UNSAFE)? eval$eval : $comp->reval($eval)}if ($@){my$err=$@;if (ref$err){if ($err->{line}=~ /([\$*])([\w\:\']*)\bVERSION\b.*?\=(.*)/){local($^W)=0;my ($sigil,$vstr)=($1,$3);$self->_restore_overloaded_stuff(1)if$err->{line}=~ /use\s+version\b|version\->|qv\(/;$v=($self->{UNSAFE}|| $UNSAFE)? eval$vstr : $comp->reval($vstr);$v=$$v if$sigil eq '*' && ref$v}if ($@ or!$v){$self->_verbose(1,sprintf("reval failed: err[%s] for eval[%s]",JSON::PP::encode_json($err),$eval,));$v=JSON::PP::encode_json($err)}}else {$v=JSON::PP::encode_json({openerr=>$err })}}if (defined$v){$v=$v->numify if ref($v)=~ /^version(::vpp)?$/}else {$v=""}if ($self->{FORK}|| $FORK){open my$fh,'>:utf8',$tmpfile;print$fh $v;exit 0}else {utf8::encode($v);$v=undef if defined$v &&!length$v;$comp->erase;$self->_restore_overloaded_stuff}}}unlink$tmpfile if ($self->{FORK}|| $FORK)&& -e $tmpfile;return$self->_normalize_version($v)}sub _restore_overloaded_stuff {my ($self,$used_version_in_safe)=@_;return if$self->{UNSAFE}|| $UNSAFE;no strict 'refs';no warnings 'redefine';my$restored;if ($INC{'version/vxs.pm'}){*{'version::(""'}=\&version::vxs::stringify;*{'version::(0+'}=\&version::vxs::numify;*{'version::(cmp'}=\&version::vxs::VCMP;*{'version::(<=>'}=\&version::vxs::VCMP;*{'version::(bool'}=\&version::vxs::boolean;$restored=1}if ($INC{'version/vpp.pm'}){{package charstar;overload->import}if (!$used_version_in_safe){package version::vpp;overload->import}unless ($restored){*{'version::(""'}=\&version::vpp::stringify;*{'version::(0+'}=\&version::vpp::numify;*{'version::(cmp'}=\&version::vpp::vcmp;*{'version::(<=>'}=\&version::vpp::vcmp;*{'version::(bool'}=\&version::vpp::vbool}*{'version::vpp::(""'}=\&version::vpp::stringify;*{'version::vpp::(0+'}=\&version::vpp::numify;*{'version::vpp::(cmp'}=\&version::vpp::vcmp;*{'version::vpp::(<=>'}=\&version::vpp::vcmp;*{'version::vpp::(bool'}=\&version::vpp::vbool;*{'charstar::(""'}=\&charstar::thischar;*{'charstar::(0+'}=\&charstar::thischar;*{'charstar::(++'}=\&charstar::increment;*{'charstar::(--'}=\&charstar::decrement;*{'charstar::(+'}=\&charstar::plus;*{'charstar::(-'}=\&charstar::minus;*{'charstar::(*'}=\&charstar::multiply;*{'charstar::(cmp'}=\&charstar::cmp;*{'charstar::(<=>'}=\&charstar::spaceship;*{'charstar::(bool'}=\&charstar::thischar;*{'charstar::(='}=\&charstar::clone;$restored=1}if (!$restored){*{'version::(""'}=\&version::stringify;*{'version::(0+'}=\&version::numify;*{'version::(cmp'}=\&version::vcmp;*{'version::(<=>'}=\&version::vcmp;*{'version::(bool'}=\&version::boolean}}sub _packages_per_pmfile {my$self=shift;my$ppp={};my$pmfile=$self->{PMFILE};my$filemtime=$self->{MTIME};my$version=$self->{VERSION};open my$fh,"<","$pmfile" or return$ppp;local $/="\n";my$inpod=0;PLINE: while (<$fh>){chomp;my($pline)=$_;$inpod=$pline =~ /^=(?!cut)/ ? 1 : $pline =~ /^=cut/ ? 0 : $inpod;next if$inpod;next if substr($pline,0,4)eq "=cut";$pline =~ s/\#.*//;next if$pline =~ /^\s*$/;if ($pline =~ /^__(?:END|DATA)__\b/ and $pmfile !~ /\.PL$/){last PLINE}my$pkg;my$strict_version;if ($pline =~ m{
401 # (.*) # takes too much time if $pline is long
402 (?<![*\$\\@%&]) # no sigils
403 \bpackage\s+
404 ([\w\:\']+)
405 \s*
406 (?: $ | [\}\;] | \{ | \s+($version::STRICT) )
407 }x){$pkg=$1;$strict_version=$2;if ($pkg eq "DB"){next PLINE}}if ($pkg){$pkg =~ s/\'/::/;next PLINE unless$pkg =~ /^[A-Za-z]/;next PLINE unless$pkg =~ /\w$/;next PLINE if$pkg eq "main";next PLINE if length($pkg)> 128;$ppp->{$pkg}{parsed}++;$ppp->{$pkg}{infile}=$pmfile;if ($self->_simile($pmfile,$pkg)){$ppp->{$pkg}{simile}=$pmfile;if ($self->_version_from_meta_ok){my$provides=$self->{META_CONTENT}{provides};if (exists$provides->{$pkg}){if (defined$provides->{$pkg}{version}){my$v=$provides->{$pkg}{version};if ($v =~ /[_\s]/ &&!$self->{ALLOW_DEV_VERSION}&&!$ALLOW_DEV_VERSION){next PLINE}unless (eval {$version=$self->_normalize_version($v);1}){$self->_verbose(1,"error with version in $pmfile: $@");next}$ppp->{$pkg}{version}=$version}else {$ppp->{$pkg}{version}="undef"}}}else {if (defined$strict_version){$ppp->{$pkg}{version}=$strict_version }else {$ppp->{$pkg}{version}=defined$version ? $version : ""}no warnings;if ($version eq 'undef'){$ppp->{$pkg}{version}=$version unless defined$ppp->{$pkg}{version}}else {$ppp->{$pkg}{version}=$version if$version > $ppp->{$pkg}{version}|| $version gt $ppp->{$pkg}{version}}}}else {$ppp->{$pkg}{version}=$version unless defined$ppp->{$pkg}{version}&& length($ppp->{$pkg}{version})}$ppp->{$pkg}{filemtime}=$filemtime}else {}}close$fh;$ppp}{no strict;sub _parse_version_safely {my($parsefile)=@_;my$result;local*FH;local $/="\n";open(FH,$parsefile)or die "Could not open '$parsefile': $!";my$inpod=0;while (<FH>){$inpod=/^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $inpod;next if$inpod || /^\s*#/;last if /^__(?:END|DATA)__\b/;chop;if (my ($ver)=/package \s+ \S+ \s+ (\S+) \s* [;{]/x){return$ver if version::is_lax($ver)}next unless /(?<!\\)([\$*])(([\w\:\']*)\bVERSION)\b.*(?<![!><=])\=(?![=>])/;my$current_parsed_line=$_;my$eval=qq{
408 package #
409 ExtUtils::MakeMaker::_version;
410
411 local $1$2;
412 \$$2=undef; do {
413 $_
414 }; \$$2
415 };local $^W=0;local$SIG{__WARN__}=sub {};$result=__clean_eval($eval);if ($@ or!defined$result){die +{eval=>$eval,line=>$current_parsed_line,file=>$parsefile,err=>$@,}}last}close FH;$result="undef" unless defined$result;if ((ref$result)=~ /^version(?:::vpp)?\b/){$result=$result->numify}return$result}}sub _filter_ppps {my($self,@ppps)=@_;my@res;MANI: for my$ppp (@ppps){if ($self->{META_CONTENT}){my$no_index=$self->{META_CONTENT}{no_index}|| $self->{META_CONTENT}{private};if (ref($no_index)eq 'HASH'){my%map=(package=>qr{\z},namespace=>qr{::},);for my$k (qw(package namespace)){next unless my$v=$no_index->{$k};my$rest=$map{$k};if (ref$v eq "ARRAY"){for my$ve (@$v){$ve =~ s|::$||;if ($ppp =~ /^$ve$rest/){$self->_verbose(1,"Skipping ppp[$ppp] due to ve[$ve]");next MANI}else {$self->_verbose(1,"NOT skipping ppp[$ppp] due to ve[$ve]")}}}else {$v =~ s|::$||;if ($ppp =~ /^$v$rest/){$self->_verbose(1,"Skipping ppp[$ppp] due to v[$v]");next MANI}else {$self->_verbose(1,"NOT skipping ppp[$ppp] due to v[$v]")}}}}else {$self->_verbose(1,"No keyword 'no_index' or 'private' in META_CONTENT")}}else {}push@res,$ppp}$self->_verbose(1,"Result of filter_ppps: res[@res]");@res}sub _simile {my($self,$file,$package)=@_;$file =~ s|.*/||;$file =~ s|\.pm(?:\.PL)?||;my$ret=$package =~ m/\b\Q$file\E$/;$ret ||= 0;unless ($ret){$ret=1 if lc$file eq 'version'}$self->_verbose(1,"Result of simile(): file[$file] package[$package] ret[$ret]\n");$ret}sub _normalize_version {my($self,$v)=@_;$v="undef" unless defined$v;my$dv=Dumpvalue->new;my$sdv=$dv->stringify($v,1);$self->_verbose(1,"Result of normalize_version: sdv[$sdv]\n");return$v if$v eq "undef";return$v if$v =~ /^\{.*\}$/;$v =~ s/^\s+//;$v =~ s/\s+\z//;if ($v =~ /_/){return$v }if (!version::is_lax($v)){return JSON::PP::encode_json({x_normalize=>'version::is_lax failed',version=>$v })}my$vv=eval {no warnings;version->new($v)->numify};if ($@){return JSON::PP::encode_json({x_normalize=>$@,version=>$v })}if ($vv eq $v){}else {my$forced=$self->_force_numeric($v);if ($forced eq $vv){}elsif ($forced =~ /^v(.+)/){$vv=version->new($1)->numify}else {if ($forced==$vv){$vv=$forced}}}return$vv}sub _force_numeric {my($self,$v)=@_;$v=$self->_readable($v);if ($v =~ /^(\+?)(\d*)(\.(\d*))?/ && (defined $2 && length $2 || defined $4 && length $4)){my$two=defined $2 ? $2 : "";my$three=defined $3 ? $3 : "";$v="$two$three"}$v}sub _version_from_meta_ok {my($self)=@_;return$self->{VERSION_FROM_META_OK}if exists$self->{VERSION_FROM_META_OK};my$c=$self->{META_CONTENT};return($self->{VERSION_FROM_META_OK}=0)unless$c->{provides};my ($mb_v)=(defined$c->{generated_by}? $c->{generated_by}: '')=~ /Module::Build version ([\d\.]+)/;return($self->{VERSION_FROM_META_OK}=1)unless$mb_v;return($self->{VERSION_FROM_META_OK}=1)if$mb_v eq '0.250.0';if ($mb_v >= 0.19 && $mb_v < 0.26 &&!keys %{$c->{provides}}){return($self->{VERSION_FROM_META_OK}=0)}return($self->{VERSION_FROM_META_OK}=1)}sub _verbose {my($self,$level,@what)=@_;warn@what if$level <= ((ref$self && $self->{VERBOSE})|| $VERBOSE)}sub _vcmp {my($self,$l,$r)=@_;local($^W)=0;$self->_verbose(9,"l[$l] r[$r]");return 0 if$l eq $r;for ($l,$r){s/_//g}$self->_verbose(9,"l[$l] r[$r]");for ($l,$r){next unless tr/.// > 1 || /^v/;s/^v?/v/;1 while s/\.0+(\d)/.$1/}$self->_verbose(9,"l[$l] r[$r]");if ($l=~/^v/ <=> $r=~/^v/){for ($l,$r){next if /^v/;$_=$self->_float2vv($_)}}$self->_verbose(9,"l[$l] r[$r]");my$lvstring="v0";my$rvstring="v0";if ($] >= 5.006 && $l =~ /^v/ && $r =~ /^v/){$lvstring=$self->_vstring($l);$rvstring=$self->_vstring($r);$self->_verbose(9,sprintf "lv[%vd] rv[%vd]",$lvstring,$rvstring)}return (($l ne "undef")<=> ($r ne "undef")|| $lvstring cmp $rvstring || $l <=> $r || $l cmp $r)}sub _vgt {my($self,$l,$r)=@_;$self->_vcmp($l,$r)> 0}sub _vlt {my($self,$l,$r)=@_;$self->_vcmp($l,$r)< 0}sub _vge {my($self,$l,$r)=@_;$self->_vcmp($l,$r)>= 0}sub _vle {my($self,$l,$r)=@_;$self->_vcmp($l,$r)<= 0}sub _vstring {my($self,$n)=@_;$n =~ s/^v// or die "Parse::PMFile::_vstring() called with invalid arg [$n]";pack "U*",split /\./,$n}sub _float2vv {my($self,$n)=@_;my($rev)=int($n);$rev ||= 0;my($mantissa)=$n =~ /\.(\d{1,12})/;$mantissa ||= 0;$mantissa .= "0" while length($mantissa)%3;my$ret="v" .$rev;while ($mantissa){$mantissa =~ s/(\d{1,3})// or die "Panic: length>0 but not a digit? mantissa[$mantissa]";$ret .= ".".int($1)}$ret =~ s/(\.0)+/.0/;$ret}sub _readable {my($self,$n)=@_;$n =~ /^([\w\-\+\.]+)/;return $1 if defined $1 && length($1)>0;if ($] < 5.006){$self->_verbose(9,"Suspicious version string seen [$n]\n");return$n}my$better=sprintf "v%vd",$n;$self->_verbose(9,"n[$n] better[$better]");return$better}1;
416 PARSE_PMFILE
417  
418 2 $fatpacked{"String/ShellQuote.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'STRING_SHELLQUOTE';
419 0 ▶ package String::ShellQuote;use strict;use vars qw($VERSION @ISA @EXPORT);require Exporter;$VERSION='1.04';@ISA=qw(Exporter);@EXPORT=qw(shell_quote shell_quote_best_effort shell_comment_quote);sub croak {require Carp;goto&Carp::croak}sub _shell_quote_backend {my@in=@_;my@err=();if (0){require RS::Handy;print RS::Handy::data_dump(\@in)}return \@err,'' unless@in;my$ret='';my$saw_non_equal=0;for (@in){if (!defined $_ or $_ eq ''){$_="''";next}if (s/\x00//g){push@err,"No way to quote string containing null (\\000) bytes"}my$escape=0;if (/=/){if (!$saw_non_equal){$escape=1}}else {$saw_non_equal=1}if (m|[^\w!%+,\-./:=@^]|){$escape=1}if ($escape || (!$saw_non_equal && /=/)){s/'/'\\''/g;s|((?:'\\''){2,})|q{'"} . (q{'} x (length($1) / 4)) . q{"'}|ge;$_="'$_'";s/^''//;s/''$//}}continue {$ret .= "$_ "}chop$ret;return \@err,$ret}sub shell_quote {my ($rerr,$s)=_shell_quote_backend @_;if (@$rerr){my%seen;@$rerr=grep {!$seen{$_}++}@$rerr;my$s=join '',map {"shell_quote(): $_\n"}@$rerr;chomp$s;croak$s}return$s}sub shell_quote_best_effort {my ($rerr,$s)=_shell_quote_backend @_;return$s}sub shell_comment_quote {return '' unless @_;unless (@_==1){croak "Too many arguments to shell_comment_quote " ."(got " .@_ ." expected 1)"}local $_=shift;s/\n/\n#/g;return $_}1;
Subroutine BEGIN: called CC=1 SCAR=5.9
Subroutine BEGIN: called CC=1 SCAR=5.9
Subroutine _shell_quote_backend: not called CC=12 SCAR=48.5
Subroutine croak: not called CC=1 SCAR=5.9
Subroutine shell_comment_quote: not called CC=3 SCAR=23.2
Subroutine shell_quote: not called CC=2 SCAR=16.5
Subroutine shell_quote_best_effort: not called CC=1 SCAR=5.9
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Branch: 10 branches
BranchTrueFalseTotal
unless @in 0 0 0
if (not defined $_ or $_ eq "") 0 0 0
if (s/\x00//g) 0 0 0
if (/=/) { } 0 0 0
unless ($saw_non_equal) 0 0 0
if (m[[^\w!%+,\-./:=\@^]]) 0 0 0
if ($escape or not $saw_non_equal and /=/) 0 0 0
unless @_ 0 0 0
unless (@_ == 1) 0 0 0
if (@$rerr) 0 0 0
Condition0%0/9
not defined $_ or $_ eq ""
l!l&&r!l&&!r
000
$escape or not $saw_non_equal and /=/
l!l&&r!l&&!r
000
not $saw_non_equal and /=/
!ll&&!rl&&r
000
MC/DC0%0/2
not defined $_ or $_ eq ""
not defined $_ $_ eq ""
MC/DC0%0/3
$escape or not $saw_non_equal and /=/
$escape not $saw_non_equal /=/
Truth table0%0/3
not(A) or B
A= not defined $_B= $_ eq ""
ABresult
1X1
011
000
Truth table0%0/4
A or not(B) and C
A= $escapeB= not $saw_non_equalC= /=/
ABCresult
1XX1
0111
00X0
0100
420 STRING_SHELLQUOTE
421  
422 2 $fatpacked{"lib/core/only.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'LIB_CORE_ONLY';
423 package lib::core::only;use strict;use warnings FATAL=>'all';use Config;sub import {@INC=@Config{qw(privlibexp archlibexp)};return}1;
424 LIB_CORE_ONLY
425  
426 2 $fatpacked{"local/lib.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'LOCAL_LIB';
427 package local::lib;use 5.006;use strict;use warnings;use Config;our$VERSION='2.000015';$VERSION=eval$VERSION;BEGIN {*_WIN32=($^O eq 'MSWin32' || $^O eq 'NetWare' || $^O eq 'symbian')? sub(){1}: sub(){0};*_USE_FSPEC=($^O eq 'MacOS' || $^O eq 'VMS' || $INC{'File/Spec.pm'})? sub(){1}: sub(){0}}our$_DIR_JOIN=_WIN32 ? '\\' : '/';our$_DIR_SPLIT=(_WIN32 || $^O eq 'cygwin')? qr{[\\/]} : qr{/};our$_ROOT=_WIN32 ? do {my$UNC=qr{[\\/]{2}[^\\/]+[\\/][^\\/]+};qr{^(?:$UNC|[A-Za-z]:|)$_DIR_SPLIT}}: qr{^/};our$_PERL;sub _cwd {my$drive=shift;if (!$_PERL){($_PERL)=$^X =~ /(.+)/;if (_is_abs($_PERL)){}elsif (-x $Config{perlpath}){$_PERL=$Config{perlpath}}else {($_PERL)=map {/(.*)/}grep {-x $_}map {join($_DIR_JOIN,$_,$_PERL)}split /\Q$Config{path_sep}\E/,$ENV{PATH}}}local@ENV{qw(PATH IFS CDPATH ENV BASH_ENV)};my$cmd=$drive ? "eval { Cwd::getdcwd(q($drive)) }" : 'getcwd';my$cwd=`"$_PERL" -MCwd -le "print $cmd"`;chomp$cwd;if (!length$cwd && $drive){$cwd=$drive}$cwd =~ s/$_DIR_SPLIT?$/$_DIR_JOIN/;$cwd}sub _catdir {if (_USE_FSPEC){require File::Spec;File::Spec->catdir(@_)}else {my$dir=join($_DIR_JOIN,@_);$dir =~ s{($_DIR_SPLIT)(?:\.?$_DIR_SPLIT)+}{$1}g;$dir}}sub _is_abs {if (_USE_FSPEC){require File::Spec;File::Spec->file_name_is_absolute($_[0])}else {$_[0]=~ $_ROOT}}sub _rel2abs {my ($dir,$base)=@_;return$dir if _is_abs($dir);$base=_WIN32 && $dir =~ s/^([A-Za-z]:)// ? _cwd("$1"): $base ? $base : _cwd;return _catdir($base,$dir)}sub import {my ($class,@args)=@_;push@args,@ARGV if $0 eq '-';my@steps;my%opts;my$shelltype;while (@args){my$arg=shift@args;if ($arg =~ /\xE2\x88\x92/ or $arg =~ /−/){die <<'DEATH'}elsif ($arg eq '--self-contained'){die <<'DEATH'}elsif($arg =~ /^--deactivate(?:=(.*))?$/){my$path=defined $1 ? $1 : shift@args;push@steps,['deactivate',$path]}elsif ($arg eq '--deactivate-all'){push@steps,['deactivate_all']}elsif ($arg =~ /^--shelltype(?:=(.*))?$/){$shelltype=defined $1 ? $1 : shift@args}elsif ($arg eq '--no-create'){$opts{no_create}=1}elsif ($arg =~ /^--/){die "Unknown import argument: $arg"}else {push@steps,['activate',$arg]}}if (!@steps){push@steps,['activate',undef]}my$self=$class->new(%opts);for (@steps){my ($method,@args)=@$_;$self=$self->$method(@args)}if ($0 eq '-'){print$self->environment_vars_string($shelltype);exit 0}else {$self->setup_local_lib}}sub new {my$class=shift;bless {@_},$class}sub clone {my$self=shift;bless {%$self,@_},ref$self}sub inc {$_[0]->{inc}||= \@INC}sub libs {$_[0]->{libs}||= [\'PERL5LIB' ]}sub bins {$_[0]->{bins}||= [\'PATH' ]}sub roots {$_[0]->{roots}||= [\'PERL_LOCAL_LIB_ROOT' ]}sub extra {$_[0]->{extra}||= {}}sub no_create {$_[0]->{no_create}}my$_archname=$Config{archname};my$_version=$Config{version};my@_inc_version_list=reverse split / /,$Config{inc_version_list};my$_path_sep=$Config{path_sep};sub _as_list {my$list=shift;grep length,map {!(ref $_ && ref $_ eq 'SCALAR')? $_ : (defined$ENV{$$_}? split(/\Q$_path_sep/,$ENV{$$_}): ())}ref$list ? @$list : $list}sub _remove_from {my ($list,@remove)=@_;return @$list if!@remove;my%remove=map {$_=>1}@remove;grep!$remove{$_},_as_list($list)}my@_lib_subdirs=([$_version,$_archname],[$_version],[$_archname],(@_inc_version_list ? \@_inc_version_list : ()),[],);sub install_base_bin_path {my ($class,$path)=@_;return _catdir($path,'bin')}sub install_base_perl_path {my ($class,$path)=@_;return _catdir($path,'lib','perl5')}sub install_base_arch_path {my ($class,$path)=@_;_catdir($class->install_base_perl_path($path),$_archname)}sub lib_paths_for {my ($class,$path)=@_;my$base=$class->install_base_perl_path($path);return map {_catdir($base,@$_)}@_lib_subdirs}sub _mm_escape_path {my$path=shift;$path =~ s/\\/\\\\/g;if ($path =~ s/ /\\ /g){$path=qq{"$path"}}return$path}sub _mb_escape_path {my$path=shift;$path =~ s/\\/\\\\/g;return qq{"$path"}}sub installer_options_for {my ($class,$path)=@_;return (PERL_MM_OPT=>defined$path ? "INSTALL_BASE="._mm_escape_path($path): undef,PERL_MB_OPT=>defined$path ? "--install_base "._mb_escape_path($path): undef,)}sub active_paths {my ($self)=@_;$self=ref$self ? $self : $self->new;return grep {my$active_ll=$self->install_base_perl_path($_);grep {$_ eq $active_ll}@{$self->inc}}_as_list($self->roots)}sub deactivate {my ($self,$path)=@_;$self=$self->new unless ref$self;$path=$self->resolve_path($path);$path=$self->normalize_path($path);my@active_lls=$self->active_paths;if (!grep {$_ eq $path}@active_lls){warn "Tried to deactivate inactive local::lib '$path'\n";return$self}my%args=(bins=>[_remove_from($self->bins,$self->install_base_bin_path($path))],libs=>[_remove_from($self->libs,$self->install_base_perl_path($path))],inc=>[_remove_from($self->inc,$self->lib_paths_for($path))],roots=>[_remove_from($self->roots,$path)],);$args{extra}={$self->installer_options_for($args{roots}[0])};$self->clone(%args)}sub deactivate_all {my ($self)=@_;$self=$self->new unless ref$self;my@active_lls=$self->active_paths;my%args;if (@active_lls){%args=(bins=>[_remove_from($self->bins,map$self->install_base_bin_path($_),@active_lls)],libs=>[_remove_from($self->libs,map$self->install_base_perl_path($_),@active_lls)],inc=>[_remove_from($self->inc,map$self->lib_paths_for($_),@active_lls)],roots=>[_remove_from($self->roots,@active_lls)],)}$args{extra}={$self->installer_options_for(undef)};$self->clone(%args)}sub activate {my ($self,$path)=@_;$self=$self->new unless ref$self;$path=$self->resolve_path($path);$self->ensure_dir_structure_for($path)unless$self->no_create;$path=$self->normalize_path($path);my@active_lls=$self->active_paths;if (grep {$_ eq $path}@active_lls[1 .. $#active_lls]){$self=$self->deactivate($path)}my%args;if (!@active_lls || $active_lls[0]ne $path){%args=(bins=>[$self->install_base_bin_path($path),@{$self->bins}],libs=>[$self->install_base_perl_path($path),@{$self->libs}],inc=>[$self->lib_paths_for($path),@{$self->inc}],roots=>[$path,@{$self->roots}],)}$args{extra}={$self->installer_options_for($path)};$self->clone(%args)}sub normalize_path {my ($self,$path)=@_;$path=(Win32::GetShortPathName($path)|| $path)if $^O eq 'MSWin32';return$path}sub build_environment_vars_for {my$self=$_[0]->new->activate($_[1]);$self->build_environment_vars}sub build_activate_environment_vars_for {my$self=$_[0]->new->activate($_[1]);$self->build_environment_vars}sub build_deactivate_environment_vars_for {my$self=$_[0]->new->deactivate($_[1]);$self->build_environment_vars}sub build_deact_all_environment_vars_for {my$self=$_[0]->new->deactivate_all;$self->build_environment_vars}sub build_environment_vars {my$self=shift;(PATH=>join($_path_sep,_as_list($self->bins)),PERL5LIB=>join($_path_sep,_as_list($self->libs)),PERL_LOCAL_LIB_ROOT=>join($_path_sep,_as_list($self->roots)),%{$self->extra},)}sub setup_local_lib_for {my$self=$_[0]->new->activate($_[1]);$self->setup_local_lib}sub setup_local_lib {my$self=shift;require Carp::Heavy if$INC{'Carp.pm'};$self->setup_env_hash;@INC=@{$self->inc}}sub setup_env_hash_for {my$self=$_[0]->new->activate($_[1]);$self->setup_env_hash}sub setup_env_hash {my$self=shift;my%env=$self->build_environment_vars;for my$key (keys%env){if (defined$env{$key}){$ENV{$key}=$env{$key}}else {delete$ENV{$key}}}}sub print_environment_vars_for {print $_[0]->environment_vars_string_for(@_[1..$#_])}sub environment_vars_string_for {my$self=$_[0]->new->activate($_[1]);$self->environment_vars_string}sub environment_vars_string {my ($self,$shelltype)=@_;$shelltype ||= $self->guess_shelltype;my$extra=$self->extra;my@envs=(PATH=>$self->bins,PERL5LIB=>$self->libs,PERL_LOCAL_LIB_ROOT=>$self->roots,map {$_=>$extra->{$_}}sort keys %$extra,);$self->_build_env_string($shelltype,\@envs)}sub _build_env_string {my ($self,$shelltype,$envs)=@_;my@envs=@$envs;my$build_method="build_${shelltype}_env_declaration";my$out='';while (@envs){my ($name,$value)=(shift(@envs),shift(@envs));if (ref$value && @$value==1 && ref$value->[0]&& ref$value->[0]eq 'SCALAR' && ${$value->[0]}eq $name){next}$out .= $self->$build_method($name,$value)}my$wrap_method="wrap_${shelltype}_output";if ($self->can($wrap_method)){return$self->$wrap_method($out)}return$out}sub build_bourne_env_declaration {my ($class,$name,$args)=@_;my$value=$class->_interpolate($args,'${%s}',qr/["\\\$!`]/,'\\%s');if (!defined$value){return qq{unset $name;\n}}$value =~ s/(^|\G|$_path_sep)\$\{$name\}$_path_sep/$1\${$name}\${$name+$_path_sep}/g;$value =~ s/$_path_sep\$\{$name\}$/\${$name+$_path_sep}\${$name}/;qq{${name}="$value"; export ${name};\n}}sub build_csh_env_declaration {my ($class,$name,$args)=@_;my ($value,@vars)=$class->_interpolate($args,'${%s}','"','"\\%s"');if (!defined$value){return qq{unsetenv $name;\n}}my$out='';for my$var (@vars){$out .= qq{if ! \$?$name setenv $name '';\n}}my$value_without=$value;if ($value_without =~ s/(?:^|$_path_sep)\$\{$name\}(?:$_path_sep|$)//g){$out .= qq{if "\${$name}" != '' setenv $name "$value";\n};$out .= qq{if "\${$name}" == '' }}$out .= qq{setenv $name "$value_without";\n};return$out}sub build_cmd_env_declaration {my ($class,$name,$args)=@_;my$value=$class->_interpolate($args,'%%%s%%',qr(%),'%s');if (!$value){return qq{\@set $name=\n}}my$out='';my$value_without=$value;if ($value_without =~ s/(?:^|$_path_sep)%$name%(?:$_path_sep|$)//g){$out .= qq{\@if not "%$name%"=="" set "$name=$value"\n};$out .= qq{\@if "%$name%"=="" }}$out .= qq{\@set "$name=$value_without"\n};return$out}sub build_powershell_env_declaration {my ($class,$name,$args)=@_;my$value=$class->_interpolate($args,'$env:%s','"','`%s');if (!$value){return qq{Remove-Item -ErrorAction 0 Env:\\$name;\n}}my$maybe_path_sep=qq{\$(if("\$env:$name"-eq""){""}else{"$_path_sep"})};$value =~ s/(^|\G|$_path_sep)\$env:$name$_path_sep/$1\$env:$name"+$maybe_path_sep+"/g;$value =~ s/$_path_sep\$env:$name$/"+$maybe_path_sep+\$env:$name+"/;qq{\$env:$name = \$("$value");\n}}sub wrap_powershell_output {my ($class,$out)=@_;return$out || " \n"}sub build_fish_env_declaration {my ($class,$name,$args)=@_;my$value=$class->_interpolate($args,'$%s',qr/[\\"' ]/,'\\%s');if (!defined$value){return qq{set -e $name;\n}}$value =~ s/$_path_sep/ /g;qq{set -x $name $value;\n}}sub _interpolate {my ($class,$args,$var_pat,$escape,$escape_pat)=@_;return unless defined$args;my@args=ref$args ? @$args : $args;return unless@args;my@vars=map {$$_}grep {ref $_ eq 'SCALAR'}@args;my$string=join$_path_sep,map {ref $_ eq 'SCALAR' ? sprintf($var_pat,$$_): do {s/($escape)/sprintf($escape_pat, $1)/ge;$_}}@args;return wantarray ? ($string,\@vars): $string}sub pipeline;sub pipeline {my@methods=@_;my$last=pop(@methods);if (@methods){\sub {my ($obj,@args)=@_;$obj->${pipeline@methods}($obj->$last(@args))}}else {\sub {shift->$last(@_)}}}sub resolve_path {my ($class,$path)=@_;$path=$class->${pipeline qw(resolve_relative_path resolve_home_path resolve_empty_path)}($path);$path}sub resolve_empty_path {my ($class,$path)=@_;if (defined$path){$path}else {'~/perl5'}}sub resolve_home_path {my ($class,$path)=@_;$path =~ /^~([^\/]*)/ or return$path;my$user=$1;my$homedir=do {if (!length($user)&& defined$ENV{HOME}){$ENV{HOME}}else {require File::Glob;File::Glob::bsd_glob("~$user",File::Glob::GLOB_TILDE())}};unless (defined$homedir){require Carp;require Carp::Heavy;Carp::croak("Couldn't resolve homedir for " .(defined$user ? $user : 'current user'))}$path =~ s/^~[^\/]*/$homedir/;$path}sub resolve_relative_path {my ($class,$path)=@_;_rel2abs($path)}sub ensure_dir_structure_for {my ($class,$path)=@_;unless (-d $path){warn "Attempting to create directory ${path}\n"}require File::Basename;my@dirs;while(!-d $path){push@dirs,$path;$path=File::Basename::dirname($path)}mkdir $_ for reverse@dirs;return}sub guess_shelltype {my$shellbin=defined$ENV{SHELL}? ($ENV{SHELL}=~ /([\w.]+)$/)[-1]: ($^O eq 'MSWin32' && exists$ENV{'!EXITCODE'})? 'bash' : ($^O eq 'MSWin32' && $ENV{PROMPT}&& $ENV{COMSPEC})? ($ENV{COMSPEC}=~ /([\w.]+)$/)[-1]: ($^O eq 'MSWin32' &&!$ENV{PROMPT})? 'powershell.exe' : 'sh';for ($shellbin){return /csh$/ ? 'csh' : /fish/ ? 'fish' : /command(?:\.com)?$/i ? 'cmd' : /cmd(?:\.exe)?$/i ? 'cmd' : /4nt(?:\.exe)?$/i ? 'cmd' : /powershell(?:\.exe)?$/i ? 'powershell' : 'bourne'}}1;
428 WHOA THERE! It looks like you've got some fancy dashes in your commandline!
429 These are *not* the traditional -- dashes that software recognizes. You
430 probably got these by copy-pasting from the perldoc for this module as
431 rendered by a UTF8-capable formatter. This most typically happens on an OS X
432 terminal, but can happen elsewhere too. Please try again after replacing the
433 dashes with normal minus signs.
434 DEATH
435 FATAL: The local::lib --self-contained flag has never worked reliably and the
436 original author, Mark Stosberg, was unable or unwilling to maintain it. As
437 such, this flag has been removed from the local::lib codebase in order to
438 prevent misunderstandings and potentially broken builds. The local::lib authors
439 recommend that you look at the lib::core::only module shipped with this
440 distribution in order to create a more robust environment that is equivalent to
441 what --self-contained provided (although quite possibly not what you originally
442 thought it provided due to the poor quality of the documentation, for which we
443 apologise).
444 DEATH
445 LOCAL_LIB
446  
447 2 $fatpacked{"parent.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'PARENT';
448 package parent;use strict;use vars qw($VERSION);$VERSION='0.228';sub import {my$class=shift;my$inheritor=caller(0);if (@_ and $_[0]eq '-norequire'){shift @_}else {for (my@filename=@_){if ($_ eq $inheritor){warn "Class '$inheritor' tried to inherit from itself\n"};s{::|'}{/}g;require "$_.pm"}}{no strict 'refs';push @{"$inheritor\::ISA"},@_}};"All your base are belong to us"
449 PARENT
450  
451 2 $fatpacked{"version.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'VERSION';
452 package version;use 5.006002;use strict;use warnings::register;if ($] >= 5.015){warnings::register_categories(qw/version/)}our$VERSION=0.9929;our$CLASS='version';our (@ISA,$STRICT,$LAX);{local$SIG{'__DIE__'};if (1){eval "use version::vpp $VERSION";die "$@" if ($@);push@ISA,"version::vpp";local $^W;*version::qv=\&version::vpp::qv;*version::declare=\&version::vpp::declare;*version::_VERSION=\&version::vpp::_VERSION;*version::vcmp=\&version::vpp::vcmp;*version::new=\&version::vpp::new;*version::numify=\&version::vpp::numify;*version::normal=\&version::vpp::normal;if ($] >= 5.009000){no strict 'refs';*version::stringify=\&version::vpp::stringify;*{'version::(""'}=\&version::vpp::stringify;*{'version::(<=>'}=\&version::vpp::vcmp;*{'version::(cmp'}=\&version::vpp::vcmp;*version::parse=\&version::vpp::parse}}else {push@ISA,"version::vxs";local $^W;*version::declare=\&version::vxs::declare;*version::qv=\&version::vxs::qv;*version::_VERSION=\&version::vxs::_VERSION;*version::vcmp=\&version::vxs::VCMP;*version::new=\&version::vxs::new;*version::numify=\&version::vxs::numify;*version::normal=\&version::vxs::normal;if ($] >= 5.009000){no strict 'refs';*version::stringify=\&version::vxs::stringify;*{'version::(""'}=\&version::vxs::stringify;*{'version::(<=>'}=\&version::vxs::VCMP;*{'version::(cmp'}=\&version::vxs::VCMP;*version::parse=\&version::vxs::parse}}}require version::regex;*version::is_lax=\&version::regex::is_lax;*version::is_strict=\&version::regex::is_strict;*LAX=\$version::regex::LAX;*LAX_DECIMAL_VERSION=\$version::regex::LAX_DECIMAL_VERSION;*LAX_DOTTED_DECIMAL_VERSION=\$version::regex::LAX_DOTTED_DECIMAL_VERSION;*STRICT=\$version::regex::STRICT;*STRICT_DECIMAL_VERSION=\$version::regex::STRICT_DECIMAL_VERSION;*STRICT_DOTTED_DECIMAL_VERSION=\$version::regex::STRICT_DOTTED_DECIMAL_VERSION;sub import {no strict 'refs';my ($class)=shift;unless ($class eq $CLASS){local $^W;*{$class.'::declare'}=\&{$CLASS.'::declare'};*{$class.'::qv'}=\&{$CLASS.'::qv'}}my%args;if (@_){map {$args{$_}=1}@_}else {%args=(qv=>1,'UNIVERSAL::VERSION'=>1,)}my$callpkg=caller();if (exists($args{declare})){*{$callpkg.'::declare'}=sub {return$class->declare(shift)}unless defined(&{$callpkg.'::declare'})}if (exists($args{qv})){*{$callpkg.'::qv'}=sub {return$class->qv(shift)}unless defined(&{$callpkg.'::qv'})}if (exists($args{'UNIVERSAL::VERSION'})){local $^W;*UNIVERSAL::VERSION=\&{$CLASS.'::_VERSION'}}if (exists($args{'VERSION'})){*{$callpkg.'::VERSION'}=\&{$CLASS.'::_VERSION'}}if (exists($args{'is_strict'})){*{$callpkg.'::is_strict'}=\&{$CLASS.'::is_strict'}unless defined(&{$callpkg.'::is_strict'})}if (exists($args{'is_lax'})){*{$callpkg.'::is_lax'}=\&{$CLASS.'::is_lax'}unless defined(&{$callpkg.'::is_lax'})}}1;
453 VERSION
454  
455 2 $fatpacked{"version/regex.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'VERSION_REGEX';
456 package version::regex;use strict;our$VERSION=0.9929;my$FRACTION_PART=qr/\.[0-9]+/;my$STRICT_INTEGER_PART=qr/0|[1-9][0-9]*/;my$LAX_INTEGER_PART=qr/[0-9]+/;my$STRICT_DOTTED_DECIMAL_PART=qr/\.[0-9]{1,3}/;my$LAX_DOTTED_DECIMAL_PART=qr/\.[0-9]+/;my$LAX_ALPHA_PART=qr/_[0-9]+/;our$STRICT_DECIMAL_VERSION=qr/ $STRICT_INTEGER_PART $FRACTION_PART? /x;our$STRICT_DOTTED_DECIMAL_VERSION=qr/ v $STRICT_INTEGER_PART $STRICT_DOTTED_DECIMAL_PART{2,} /x;our$STRICT=qr/ $STRICT_DECIMAL_VERSION | $STRICT_DOTTED_DECIMAL_VERSION /x;our$LAX_DECIMAL_VERSION=qr/ $LAX_INTEGER_PART (?: $FRACTION_PART | \. )? $LAX_ALPHA_PART?
457 |
458 $FRACTION_PART $LAX_ALPHA_PART?
459 /x;our$LAX_DOTTED_DECIMAL_VERSION=qr/
460 v $LAX_INTEGER_PART (?: $LAX_DOTTED_DECIMAL_PART+ $LAX_ALPHA_PART? )?
461 |
462 $LAX_INTEGER_PART? $LAX_DOTTED_DECIMAL_PART{2,} $LAX_ALPHA_PART?
463 /x;our$LAX=qr/ undef | $LAX_DOTTED_DECIMAL_VERSION | $LAX_DECIMAL_VERSION /x;sub is_strict {defined $_[0]&& $_[0]=~ qr/ \A $STRICT \z /x}sub is_lax {defined $_[0]&& $_[0]=~ qr/ \A $LAX \z /x}1;
464 VERSION_REGEX
465  
466 2 $fatpacked{"version/vpp.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'VERSION_VPP';
467 package charstar;use overload ('""'=>\&thischar,'0+'=>\&thischar,'++'=>\&increment,'--'=>\&decrement,'+'=>\&plus,'-'=>\&minus,'*'=>\&multiply,'cmp'=>\&cmp,'<=>'=>\&spaceship,'bool'=>\&thischar,'='=>\&clone,);sub new {my ($self,$string)=@_;my$class=ref($self)|| $self;my$obj={string=>[split(//,$string)],current=>0,};return bless$obj,$class}sub thischar {my ($self)=@_;my$last=$#{$self->{string}};my$curr=$self->{current};if ($curr >= 0 && $curr <= $last){return$self->{string}->[$curr]}else {return ''}}sub increment {my ($self)=@_;$self->{current}++}sub decrement {my ($self)=@_;$self->{current}--}sub plus {my ($self,$offset)=@_;my$rself=$self->clone;$rself->{current}+= $offset;return$rself}sub minus {my ($self,$offset)=@_;my$rself=$self->clone;$rself->{current}-= $offset;return$rself}sub multiply {my ($left,$right,$swapped)=@_;my$char=$left->thischar();return$char * $right}sub spaceship {my ($left,$right,$swapped)=@_;unless (ref($right)){$right=$left->new($right)}return$left->{current}<=> $right->{current}}sub cmp {my ($left,$right,$swapped)=@_;unless (ref($right)){if (length($right)==1){return$left->thischar cmp $right}$right=$left->new($right)}return$left->currstr cmp $right->currstr}sub bool {my ($self)=@_;my$char=$self->thischar;return ($char ne '')}sub clone {my ($left,$right,$swapped)=@_;$right={string=>[@{$left->{string}}],current=>$left->{current},};return bless$right,ref($left)}sub currstr {my ($self,$s)=@_;my$curr=$self->{current};my$last=$#{$self->{string}};if (defined($s)&& $s->{current}< $last){$last=$s->{current}}my$string=join('',@{$self->{string}}[$curr..$last]);return$string}package version::vpp;use 5.006002;use strict;use warnings::register;use Config;our$VERSION=0.9929;our$CLASS='version::vpp';our ($LAX,$STRICT,$WARN_CATEGORY);if ($] > 5.015){warnings::register_categories(qw/version/);$WARN_CATEGORY='version'}else {$WARN_CATEGORY='numeric'}require version::regex;*version::vpp::is_strict=\&version::regex::is_strict;*version::vpp::is_lax=\&version::regex::is_lax;*LAX=\$version::regex::LAX;*STRICT=\$version::regex::STRICT;use overload ('""'=>\&stringify,'0+'=>\&numify,'cmp'=>\&vcmp,'<=>'=>\&vcmp,'bool'=>\&vbool,'+'=>\&vnoop,'-'=>\&vnoop,'*'=>\&vnoop,'/'=>\&vnoop,'+='=>\&vnoop,'-='=>\&vnoop,'*='=>\&vnoop,'/='=>\&vnoop,'abs'=>\&vnoop,);sub import {no strict 'refs';my ($class)=shift;unless ($class eq $CLASS){local $^W;*{$class.'::declare'}=\&{$CLASS.'::declare'};*{$class.'::qv'}=\&{$CLASS.'::qv'}}my%args;if (@_){map {$args{$_}=1}@_}else {%args=(qv=>1,'UNIVERSAL::VERSION'=>1,)}my$callpkg=caller();if (exists($args{declare})){*{$callpkg.'::declare'}=sub {return$class->declare(shift)}unless defined(&{$callpkg.'::declare'})}if (exists($args{qv})){*{$callpkg.'::qv'}=sub {return$class->qv(shift)}unless defined(&{$callpkg.'::qv'})}if (exists($args{'UNIVERSAL::VERSION'})){no warnings qw/redefine/;*UNIVERSAL::VERSION=\&{$CLASS.'::_VERSION'}}if (exists($args{'VERSION'})){*{$callpkg.'::VERSION'}=\&{$CLASS.'::_VERSION'}}if (exists($args{'is_strict'})){*{$callpkg.'::is_strict'}=\&{$CLASS.'::is_strict'}unless defined(&{$callpkg.'::is_strict'})}if (exists($args{'is_lax'})){*{$callpkg.'::is_lax'}=\&{$CLASS.'::is_lax'}unless defined(&{$callpkg.'::is_lax'})}}my$VERSION_MAX=0x7FFFFFFF;use constant TRUE=>1;use constant FALSE=>0;sub isDIGIT {my ($char)=shift->thischar();return ($char =~ /\d/)}sub isALPHA {my ($char)=shift->thischar();return ($char =~ /[a-zA-Z]/)}sub isSPACE {my ($char)=shift->thischar();return ($char =~ /\s/)}sub BADVERSION {my ($s,$errstr,$error)=@_;if ($errstr){$$errstr=$error}return$s}sub prescan_version {my ($s,$strict,$errstr,$sqv,$ssaw_decimal,$swidth,$salpha)=@_;my$qv=defined$sqv ? $$sqv : FALSE;my$saw_decimal=defined$ssaw_decimal ? $$ssaw_decimal : 0;my$width=defined$swidth ? $$swidth : 3;my$alpha=defined$salpha ? $$salpha : FALSE;my$d=$s;if ($qv && isDIGIT($d)){goto dotted_decimal_version}if ($d eq 'v'){$d++;if (isDIGIT($d)){$qv=TRUE}else {return BADVERSION($s,$errstr,"Invalid version format (dotted-decimal versions require at least three parts)")}dotted_decimal_version: if ($strict && $d eq '0' && isDIGIT($d+1)){return BADVERSION($s,$errstr,"Invalid version format (no leading zeros)")}while (isDIGIT($d)){$d++}if ($d eq '.'){$saw_decimal++;$d++}else {if ($strict){return BADVERSION($s,$errstr,"Invalid version format (dotted-decimal versions require at least three parts)")}else {goto version_prescan_finish}}{my$i=0;my$j=0;while (isDIGIT($d)){$i++;while (isDIGIT($d)){$d++;$j++;if ($strict && $j > 3){return BADVERSION($s,$errstr,"Invalid version format (maximum 3 digits between decimals)")}}if ($d eq '_'){if ($strict){return BADVERSION($s,$errstr,"Invalid version format (no underscores)")}if ($alpha){return BADVERSION($s,$errstr,"Invalid version format (multiple underscores)")}$d++;$alpha=TRUE}elsif ($d eq '.'){if ($alpha){return BADVERSION($s,$errstr,"Invalid version format (underscores before decimal)")}$saw_decimal++;$d++}elsif (!isDIGIT($d)){last}$j=0}if ($strict && $i < 2){return BADVERSION($s,$errstr,"Invalid version format (dotted-decimal versions require at least three parts)")}}}else {my$j=0;if ($strict){if ($d eq '.'){return BADVERSION($s,$errstr,"Invalid version format (0 before decimal required)")}if ($d eq '0' && isDIGIT($d+1)){return BADVERSION($s,$errstr,"Invalid version format (no leading zeros)")}}if ($d eq '-'){return BADVERSION($s,$errstr,"Invalid version format (negative version number)")}while (isDIGIT($d)){$d++}if ($d eq '.'){$saw_decimal++;$d++}elsif (!$d || $d eq ';' || isSPACE($d)|| $d eq '}'){if ($d==$s){return BADVERSION($s,$errstr,"Invalid version format (version required)")}goto version_prescan_finish}elsif ($d==$s){return BADVERSION($s,$errstr,"Invalid version format (non-numeric data)")}elsif ($d eq '_'){if ($strict){return BADVERSION($s,$errstr,"Invalid version format (no underscores)")}elsif (isDIGIT($d+1)){return BADVERSION($s,$errstr,"Invalid version format (alpha without decimal)")}else {return BADVERSION($s,$errstr,"Invalid version format (misplaced underscore)")}}elsif ($d){return BADVERSION($s,$errstr,"Invalid version format (non-numeric data)")}if ($d &&!isDIGIT($d)&& ($strict ||!($d eq ';' || isSPACE($d)|| $d eq '}'))){return BADVERSION($s,$errstr,"Invalid version format (fractional part required)")}while (isDIGIT($d)){$d++;$j++;if ($d eq '.' && isDIGIT($d-1)){if ($alpha){return BADVERSION($s,$errstr,"Invalid version format (underscores before decimal)")}if ($strict){return BADVERSION($s,$errstr,"Invalid version format (dotted-decimal versions must begin with 'v')")}$d=$s;$qv=TRUE;goto dotted_decimal_version}if ($d eq '_'){if ($strict){return BADVERSION($s,$errstr,"Invalid version format (no underscores)")}if ($alpha){return BADVERSION($s,$errstr,"Invalid version format (multiple underscores)")}if (!isDIGIT($d+1)){return BADVERSION($s,$errstr,"Invalid version format (misplaced underscore)")}$width=$j;$d++;$alpha=TRUE}}}version_prescan_finish: while (isSPACE($d)){$d++}if ($d &&!isDIGIT($d)&& (!($d eq ';' || $d eq '}'))){return BADVERSION($s,$errstr,"Invalid version format (non-numeric data)")}if ($saw_decimal > 1 && ($d-1)eq '.'){return BADVERSION($s,$errstr,"Invalid version format (trailing decimal)")}if (defined$sqv){$$sqv=$qv}if (defined$swidth){$$swidth=$width}if (defined$ssaw_decimal){$$ssaw_decimal=$saw_decimal}if (defined$salpha){$$salpha=$alpha}return$d}sub scan_version {my ($s,$rv,$qv)=@_;my$start;my$pos;my$last;my$errstr;my$saw_decimal=0;my$width=3;my$alpha=FALSE;my$vinf=FALSE;my@av;$s=new charstar$s;while (isSPACE($s)){$s++}$last=prescan_version($s,FALSE,\$errstr,\$qv,\$saw_decimal,\$width,\$alpha);if ($errstr){if ($s ne 'undef'){require Carp;Carp::croak($errstr)}}$start=$s;if ($s eq 'v'){$s++}$pos=$s;if ($qv){$$rv->{qv}=$qv}if ($alpha){$$rv->{alpha}=$alpha}if (!$qv && $width < 3){$$rv->{width}=$width}while (isDIGIT($pos)|| $pos eq '_'){$pos++}if (!isALPHA($pos)){my$rev;for (;;){$rev=0;{my$end=$pos;my$mult=1;my$orev;if (!$qv && $s > $start && $saw_decimal==1){$mult *= 100;while ($s < $end){next if$s eq '_';$orev=$rev;$rev += $s * $mult;$mult /= 10;if ((abs($orev)> abs($rev))|| (abs($rev)> $VERSION_MAX)){warn("Integer overflow in version %d",$VERSION_MAX);$s=$end - 1;$rev=$VERSION_MAX;$vinf=1}$s++;if ($s eq '_'){$s++}}}else {while (--$end >= $s){next if$end eq '_';$orev=$rev;$rev += $end * $mult;$mult *= 10;if ((abs($orev)> abs($rev))|| (abs($rev)> $VERSION_MAX)){warn("Integer overflow in version");$end=$s - 1;$rev=$VERSION_MAX;$vinf=1}}}}push@av,$rev;if ($vinf){$s=$last;last}elsif ($pos eq '.'){$s= ++$pos}elsif ($pos eq '_' && isDIGIT($pos+1)){$s= ++$pos}elsif ($pos eq ',' && isDIGIT($pos+1)){$s= ++$pos}elsif (isDIGIT($pos)){$s=$pos}else {$s=$pos;last}if ($qv){while (isDIGIT($pos)|| $pos eq '_'){$pos++}}else {my$digits=0;while ((isDIGIT($pos)|| $pos eq '_')&& $digits < 3){if ($pos ne '_'){$digits++}$pos++}}}}if ($qv){my$len=$#av;$len=2 - $len;while ($len-- > 0){push@av,0}}if ($vinf){$$rv->{original}="v.Inf";$$rv->{vinf}=1}elsif ($s > $start){$$rv->{original}=$start->currstr($s);if ($qv && $saw_decimal==1 && $start ne 'v'){$$rv->{original}='v' .$$rv->{original}}}else {$$rv->{original}='0';push(@av,0)}$$rv->{version}=\@av;if ($s eq 'undef'){$s += 5}return$s}sub new {my$class=shift;unless (defined$class or $#_ > 1){require Carp;Carp::croak('Usage: version::new(class, version)')}my$self=bless ({},ref ($class)|| $class);my$qv=FALSE;if ($#_==1){$qv=TRUE}my$value=pop;if (ref($value)&& eval('$value->isa("version")')){$self->{version}=[@{$value->{version}}];$self->{qv}=1 if$value->{qv};$self->{alpha}=1 if$value->{alpha};$self->{original}=''.$value->{original};return$self}if (not defined$value or $value =~ /^undef$/){push @{$self->{version}},0;$self->{original}="0";return ($self)}if (ref($value)=~ m/ARRAY|HASH/){require Carp;Carp::croak("Invalid version format (non-numeric data)")}$value=_un_vstring($value);if ($Config{d_setlocale}){use POSIX qw/locale_h/;use if$Config{d_setlocale},'locale';my$currlocale=setlocale(LC_ALL);if (localeconv()->{decimal_point}eq ','){$value =~ tr/,/./}}if ($value =~ /\d+.?\d*e[-+]?\d+/){$value=sprintf("%.9f",$value);$value =~ s/(0+)$//}my$s=scan_version($value,\$self,$qv);if ($s){warn(sprintf "Version string '%s' contains invalid data; " ."ignoring: '%s'",$value,$s)}return ($self)}*parse=\&new;sub numify {my ($self)=@_;unless (_verify($self)){require Carp;Carp::croak("Invalid version object")}my$alpha=$self->{alpha}|| "";my$len=$#{$self->{version}};my$digit=$self->{version}[0];my$string=sprintf("%d.",$digit);if ($alpha and warnings::enabled()){warnings::warn($WARN_CATEGORY,'alpha->numify() is lossy')}for (my$i=1 ;$i <= $len ;$i++ ){$digit=$self->{version}[$i];$string .= sprintf("%03d",$digit)}if ($len==0){$string .= sprintf("000")}return$string}sub normal {my ($self)=@_;unless (_verify($self)){require Carp;Carp::croak("Invalid version object")}my$len=$#{$self->{version}};my$digit=$self->{version}[0];my$string=sprintf("v%d",$digit);for (my$i=1 ;$i <= $len ;$i++ ){$digit=$self->{version}[$i];$string .= sprintf(".%d",$digit)}if ($len <= 2){for ($len=2 - $len;$len!=0;$len-- ){$string .= sprintf(".%0d",0)}}return$string}sub stringify {my ($self)=@_;unless (_verify($self)){require Carp;Carp::croak("Invalid version object")}return exists$self->{original}? $self->{original}: exists$self->{qv}? $self->normal : $self->numify}sub vcmp {my ($left,$right,$swap)=@_;die "Usage: version::vcmp(lobj, robj, ...)" if @_ < 2;my$class=ref($left);unless (UNIVERSAL::isa($right,$class)){$right=$class->new($right)}if ($swap){($left,$right)=($right,$left)}unless (_verify($left)){require Carp;Carp::croak("Invalid version object")}unless (_verify($right)){require Carp;Carp::croak("Invalid version format")}my$l=$#{$left->{version}};my$r=$#{$right->{version}};my$m=$l < $r ? $l : $r;my$lalpha=$left->is_alpha;my$ralpha=$right->is_alpha;my$retval=0;my$i=0;while ($i <= $m && $retval==0){$retval=$left->{version}[$i]<=> $right->{version}[$i];$i++}if ($retval==0 && $l!=$r){if ($l < $r){while ($i <= $r && $retval==0){if ($right->{version}[$i]!=0){$retval=-1}$i++}}else {while ($i <= $l && $retval==0){if ($left->{version}[$i]!=0){$retval= +1}$i++}}}return$retval}sub vbool {my ($self)=@_;return vcmp($self,$self->new("0"),1)}sub vnoop {require Carp;Carp::croak("operation not supported with version object")}sub is_alpha {my ($self)=@_;return (exists$self->{alpha})}sub qv {my$value=shift;my$class=$CLASS;if (@_){$class=ref($value)|| $value;$value=shift}$value=_un_vstring($value);$value='v'.$value unless$value =~ /(^v|\d+\.\d+\.\d)/;my$obj=$CLASS->new($value);return bless$obj,$class}*declare=\&qv;sub is_qv {my ($self)=@_;return (exists$self->{qv})}sub _verify {my ($self)=@_;if (ref($self)&& eval {exists$self->{version}}&& ref($self->{version})eq 'ARRAY'){return 1}else {return 0}}sub _is_non_alphanumeric {my$s=shift;$s=new charstar$s;while ($s){return 0 if isSPACE($s);return 1 unless (isALPHA($s)|| isDIGIT($s)|| $s =~ /[.-]/);$s++}return 0}sub _un_vstring {my$value=shift;if (length($value)>= 1 && $value !~ /[,._]/ && _is_non_alphanumeric($value)){my$tvalue;if ($] >= 5.008_001){$tvalue=_find_magic_vstring($value);$value=$tvalue if length$tvalue}elsif ($] >= 5.006_000){$tvalue=sprintf("v%vd",$value);if ($tvalue =~ /^v\d+(\.\d+)*$/){$value=$tvalue}}}return$value}sub _find_magic_vstring {my$value=shift;my$tvalue='';require B;my$sv=B::svref_2object(\$value);my$magic=ref($sv)eq 'B::PVMG' ? $sv->MAGIC : undef;while ($magic){if ($magic->TYPE eq 'V'){$tvalue=$magic->PTR;$tvalue =~ s/^v?(.+)$/v$1/;last}else {$magic=$magic->MOREMAGIC}}$tvalue =~ tr/_//d;return$tvalue}sub _VERSION {my ($obj,$req)=@_;my$class=ref($obj)|| $obj;no strict 'refs';if (exists$INC{"$class.pm"}and not %{"$class\::"}and $] >= 5.008){require Carp;Carp::croak("$class defines neither package nor VERSION" ."--version check failed")}my$version=eval "\$$class\::VERSION";if (defined$version){local $^W if $] <= 5.008;$version=version::vpp->new($version)}if (defined$req){unless (defined$version){require Carp;my$msg=$] < 5.006 ? "$class version $req required--this is only version " : "$class does not define \$$class\::VERSION" ."--version check failed";if ($ENV{VERSION_DEBUG}){Carp::confess($msg)}else {Carp::croak($msg)}}$req=version::vpp->new($req);if ($req > $version){require Carp;if ($req->is_qv){Carp::croak(sprintf ("%s version %s required--"."this is only version %s",$class,$req->normal,$version->normal))}else {Carp::croak(sprintf ("%s version %s required--"."this is only version %s",$class,$req->stringify,$version->stringify))}}}return defined$version ? $version->stringify : undef}1;
468 VERSION_VPP
469  
470 2 s/^ //mg for values %fatpacked;
471  
472 2 my $class = 'FatPacked::'.(0+\%fatpacked);
473 2 ▶no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
474 0 ▶*{"${class}::files"} = sub { keys %{$_[0]} };
Subroutine __ANON__: not called CC=1 SCAR=1.2
475  
476 2 ▶if ($] < 5.008) {
Branch: 1 branch
BranchTrueFalseTotal
if ($] < 5.008) { } 0 2 2
477 0 ▶ *{"${class}::INC"} = sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
478 0 ▶ if (my $fat = $_[0]{$_[1]}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $fat = $_[0]{$_[1]}) 0 0 0
479 0 my $pos = 0;
480 0 my $last = length $fat;
481 0 ▶ return (sub {
Subroutine __ANON__: not called CC=3 SCAR=24.8
482 0 ▶ return 0 if $pos == $last;
Branch: 1 branch
BranchTrueFalseTotal
if $pos == $last 0 0 0
483 0 ▶ my $next = (1 + index $fat, "\n", $pos) || $last;
Condition0%0/3
1 + index($fat, "\n", $pos) || $last
l!l&&r!l&&!r
000
MC/DC0%0/2
1 + index($fat, "\n", $pos) || $last
1 + index($fat, "\n", $pos) $last
Truth table0%0/3
A || B
A= 1 + index($fat, "\n", $pos)B= $last
ABresult
1X1
011
000
484 0 $_ .= substr $fat, $pos, $next - $pos;
485 0 $pos = $next;
486 0 return 1;
487 0 });
488 }
489 0 };
490 }
491  
492 else {
493 2 ▶ *{"${class}::INC"} = sub {
Subroutine __ANON__: called CC=3 SCAR=11.0
494 100 ▶ if (my $fat = $_[0]{$_[1]}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $fat = $_[0]{$_[1]}) 24 76 100
495 24 ▶ open my $fh, '<', \$fat
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, "<", \$fat or die "FatPacker error loading $_[1] (could be a perl installation issue?)" 24 0 24
496 or die "FatPacker error loading $_[1] (could be a perl installation issue?)";
497 24 return $fh;
498 }
499 76 return;
500 2 };
501 }
502  
503 2 unshift @INC, bless \%fatpacked, $class;
504 } # END OF FATPACK CODE
505  
506  
507  
508 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
509 2 ▶use App::cpanminus::script;
Subroutine BEGIN: called CC=1 SCAR=0.0
510  
511  
512 2 ▶unless (caller) {
Branch: 1 branch
BranchTrueFalseTotal
unless (caller) 2 0 2
513 2 my $app = App::cpanminus::script->new;
514 2 $app->parse_options(@ARGV);
515 2 exit $app->doit;
516 }
517  
518 __END__
↑ Summary blib/lib/Pinto/Editor/Edit.pm »