| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package WebAPI::DBIC::Util; |
|
2
|
|
|
|
|
|
|
$WebAPI::DBIC::Util::VERSION = '0.003002'; |
|
3
|
|
|
|
|
|
|
# based on webmachine-perl/lib/Web/Machine/Util.pm |
|
4
|
|
|
|
|
|
|
# |
|
5
|
|
|
|
|
|
|
# ABSTRACT: General Utility module |
|
6
|
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
3897668
|
use strict; |
|
|
4
|
|
|
|
|
25
|
|
|
|
4
|
|
|
|
|
220
|
|
|
8
|
4
|
|
|
4
|
|
27
|
use warnings; |
|
|
4
|
|
|
|
|
9
|
|
|
|
4
|
|
|
|
|
227
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
22
|
use Carp qw[ confess ]; |
|
|
4
|
|
|
|
|
63
|
|
|
|
4
|
|
|
|
|
416
|
|
|
11
|
4
|
|
|
4
|
|
22
|
use Scalar::Util qw[ blessed ]; |
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
917
|
|
|
12
|
4
|
|
|
4
|
|
36
|
use List::Util qw[ first ]; |
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
595
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
4
|
|
|
4
|
|
1048
|
use HTTP::Headers::ActionPack; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
use Sub::Exporter -setup => { |
|
17
|
|
|
|
|
|
|
exports => [qw[ |
|
18
|
|
|
|
|
|
|
first |
|
19
|
|
|
|
|
|
|
pair_key |
|
20
|
|
|
|
|
|
|
pair_value |
|
21
|
|
|
|
|
|
|
bind_path |
|
22
|
|
|
|
|
|
|
create_date |
|
23
|
|
|
|
|
|
|
create_header |
|
24
|
|
|
|
|
|
|
inflate_headers |
|
25
|
|
|
|
|
|
|
]] |
|
26
|
|
|
|
|
|
|
}; |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub pair_key { return ( keys %{ $_[0] } )[0] } |
|
29
|
|
|
|
|
|
|
sub pair_value { return ( values %{ $_[0] } )[0] } |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
{ |
|
32
|
|
|
|
|
|
|
my $ACTION_PACK = HTTP::Headers::ActionPack->new; |
|
33
|
|
|
|
|
|
|
sub create_header { return $ACTION_PACK->create( @_ ) } |
|
34
|
|
|
|
|
|
|
sub create_date { return $ACTION_PACK->create( 'DateHeader' => shift ) } |
|
35
|
|
|
|
|
|
|
sub inflate_headers { return $ACTION_PACK->inflate( @_ ) } |
|
36
|
|
|
|
|
|
|
sub get_action_pack { return $ACTION_PACK } |
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=pod |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=encoding UTF-8 |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 NAME |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
WebAPI::DBIC::Util - General Utility module |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 VERSION |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
version 0.003002 |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
use WebAPI::DBIC::Util; |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
This is just a basic utility module used internally by L<WebAPI::DBIC>. |
|
62
|
|
|
|
|
|
|
There is no real user servicable parts in here. |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 AUTHOR |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Tim Bunce <Tim.Bunce@pobox.com> |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Tim Bunce. |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
73
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |