| 1 | package App::CLI::Extension::Component::Stash; | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | =pod | ||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||
| 5 | =head1 NAME | ||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||
| 7 | App::CLI::Extension::Component::Stash - for App::CLI::Extension stash module | ||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||
| 9 | =head1 VERSION | ||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||
| 11 | 1.421 | ||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||
| 13 | =cut | ||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||
| 15 | 18 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 16 | 18 | ▶ | use base qw(Class::Accessor::Grouped); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||
| 18 | 18 | our $VERSION = '1.421'; | |||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||
| 20 | 18 | __PACKAGE__->mk_group_accessors("inherited" => "_stash"); | |||||||||||||||||||||||||||||||
| 21 | 18 | __PACKAGE__->_stash({}); | |||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | sub stash { | ||||||||||||||||||||||||||||||
|
Subroutine
stash: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||
| 26 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||
| 28 | 0 | my %hash; | |||||||||||||||||||||||||||||||
| 29 | 0 | ▶ | if(scalar(@_) == 1 && ref($_[0]) eq "HASH"){ | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
scalar @_ == 1 and ref $_[0] eq "HASH"
MC/DC0%0/2
scalar @_ == 1 and ref $_[0] eq "HASH"
scalar @_ == 1
ref $_[0] eq "HASH"
Truth table0%0/3
A and B
A= scalar @_ == 1B= ref $_[0] eq "HASH"
| |||||||||||||||||||||||||||||||||
| 30 | 0 | %hash = %{$_[0]}; | |||||||||||||||||||||||||||||||
| 31 | } elsif (scalar(@_) > 1) { | ||||||||||||||||||||||||||||||||
| 32 | 0 | %hash = @_; | |||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||
| 34 | 0 | my @keys = keys %hash; | |||||||||||||||||||||||||||||||
| 35 | 0 | ▶ | if (scalar(@keys) > 0) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 36 | 0 | map { $self->_stash->{$_} = $hash{$_} } @keys; | |||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||
| 38 | 0 | return $self->_stash; | |||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||
| 41 | 18 | 1; | |||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||
| 43 | __END__ | ||||||||||||||||||||||||||||||||