| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# ABSTRACT: misc utils |
|
2
|
|
|
|
|
|
|
$Net::Amazon::S3::Utils::VERSION = '0.991'; |
|
3
|
|
|
|
|
|
|
my ($self, $arguments, $positional, $aliases) = @_; |
|
4
|
|
|
|
|
|
|
my %args; |
|
5
|
355
|
|
|
355
|
0
|
2891
|
$aliases = {} unless $aliases; |
|
6
|
355
|
|
|
|
|
488
|
|
|
7
|
355
|
100
|
|
|
|
796
|
push @$arguments, %{ pop @$arguments } |
|
8
|
|
|
|
|
|
|
if @$arguments && Ref::Util::is_plain_hashref ($arguments->[-1]); |
|
9
|
355
|
100
|
100
|
|
|
1598
|
|
|
|
95
|
|
|
|
|
341
|
|
|
10
|
|
|
|
|
|
|
my %positional = map +($_ => 1), grep ! exists $args{$_}, @$positional; |
|
11
|
|
|
|
|
|
|
my $positional_count = scalar keys %positional; |
|
12
|
355
|
|
|
|
|
1670
|
while (@$arguments > 1 && @$arguments > $positional_count) { |
|
13
|
355
|
|
|
|
|
736
|
my ($name, $value) = splice @$arguments, -2, 2; |
|
14
|
355
|
|
100
|
|
|
1181
|
|
|
15
|
473
|
|
|
|
|
877
|
next if exists $args{$name}; |
|
16
|
|
|
|
|
|
|
|
|
17
|
473
|
100
|
|
|
|
838
|
$args{$name} = $value; |
|
18
|
|
|
|
|
|
|
|
|
19
|
472
|
|
|
|
|
648
|
$name = $aliases->{$name} if exists $aliases->{$name}; |
|
20
|
|
|
|
|
|
|
|
|
21
|
472
|
100
|
|
|
|
784
|
if (exists $positional{$name}) { |
|
22
|
|
|
|
|
|
|
$positional_count--; |
|
23
|
472
|
100
|
|
|
|
1132
|
delete $positional{$name}; |
|
24
|
156
|
|
|
|
|
201
|
} |
|
25
|
156
|
|
|
|
|
431
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
#die "Odd number of named arguments" |
|
28
|
|
|
|
|
|
|
# if @$arguments != $positional_count; |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
for my $key (keys %$aliases) { |
|
31
|
|
|
|
|
|
|
next unless exists $args{$key}; |
|
32
|
355
|
|
|
|
|
945
|
my $value = delete $args{$key}; |
|
33
|
290
|
100
|
|
|
|
768
|
my $alias_for = $aliases->{$key}; |
|
34
|
2
|
|
|
|
|
5
|
$args{$alias_for} = $value unless exists $args{$alias_for}; |
|
35
|
2
|
|
|
|
|
3
|
} |
|
36
|
2
|
50
|
|
|
|
7
|
|
|
37
|
|
|
|
|
|
|
for my $name (@$positional) { |
|
38
|
|
|
|
|
|
|
next if exists $args{$name}; |
|
39
|
355
|
|
|
|
|
626
|
$args{$name} = shift @$arguments; |
|
40
|
440
|
100
|
|
|
|
865
|
} |
|
41
|
284
|
|
|
|
|
613
|
|
|
42
|
|
|
|
|
|
|
return %args; |
|
43
|
|
|
|
|
|
|
} |
|
44
|
355
|
|
|
|
|
1523
|
|
|
45
|
|
|
|
|
|
|
my ($self, $arguments) = @_; |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
return $self->parse_arguments ($arguments, [qw[ bucket ]], { name => 'bucket' }); |
|
48
|
208
|
|
|
208
|
0
|
4478
|
} |
|
49
|
|
|
|
|
|
|
|
|
50
|
208
|
|
|
|
|
866
|
my ($self, $arguments) = @_; |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
return $self->parse_arguments ($arguments, [qw[ bucket key ]], { name => 'bucket' }); |
|
53
|
|
|
|
|
|
|
} |
|
54
|
7
|
|
|
7
|
0
|
3632
|
|
|
55
|
|
|
|
|
|
|
my ($self, $arguments) = @_; |
|
56
|
7
|
|
|
|
|
39
|
|
|
57
|
|
|
|
|
|
|
return $self->parse_arguments ($arguments, [qw[ key ]], { name => 'bucket' }); |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
|
|
60
|
74
|
|
|
74
|
0
|
3696
|
1; |
|
61
|
|
|
|
|
|
|
|
|
62
|
74
|
|
|
|
|
293
|
|
|
63
|
|
|
|
|
|
|
=pod |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=encoding UTF-8 |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 NAME |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Net::Amazon::S3::Utils - misc utils |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 VERSION |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
version 0.991 |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 AUTHOR |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Branislav Zahradník <barney@cpan.org> |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
This software is copyright (c) 2022 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník. |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
84
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=cut |