line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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
|
|
|
18
|
|
103
|
use strict; |
|
18
|
|
|
|
|
35
|
|
|
18
|
|
|
|
|
680
|
|
16
|
18
|
|
|
18
|
|
96
|
use base qw(Class::Accessor::Grouped); |
|
18
|
|
|
|
|
33
|
|
|
18
|
|
|
|
|
4795
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = '1.421'; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
__PACKAGE__->mk_group_accessors("inherited" => "_stash"); |
21
|
|
|
|
|
|
|
__PACKAGE__->_stash({}); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub stash { |
25
|
|
|
|
|
|
|
|
26
|
2
|
|
|
2
|
0
|
147
|
my $self = shift; |
27
|
|
|
|
|
|
|
|
28
|
2
|
|
|
|
|
4
|
my %hash; |
29
|
2
|
50
|
33
|
|
|
17
|
if(scalar(@_) == 1 && ref($_[0]) eq "HASH"){ |
|
|
50
|
|
|
|
|
|
30
|
0
|
|
|
|
|
0
|
%hash = %{$_[0]}; |
|
0
|
|
|
|
|
0
|
|
31
|
|
|
|
|
|
|
} elsif (scalar(@_) > 1) { |
32
|
0
|
|
|
|
|
0
|
%hash = @_; |
33
|
|
|
|
|
|
|
} |
34
|
2
|
|
|
|
|
5
|
my @keys = keys %hash; |
35
|
2
|
50
|
|
|
|
7
|
if (scalar(@keys) > 0) { |
36
|
0
|
|
|
|
|
0
|
map { $self->_stash->{$_} = $hash{$_} } @keys; |
|
0
|
|
|
|
|
0
|
|
37
|
|
|
|
|
|
|
} |
38
|
2
|
|
|
|
|
69
|
return $self->_stash; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |