line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mobile::WURFL::Base; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
26848
|
use 5.008004; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
80
|
|
4
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
71
|
|
5
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
103
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
11
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
156
|
|
10
|
2
|
|
|
2
|
|
92798
|
use Data::Dumper; # FIXME |
|
2
|
|
|
|
|
19446
|
|
|
2
|
|
|
|
|
900
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
16
|
0
|
|
|
|
|
|
my $args = shift; |
17
|
|
|
|
|
|
|
|
18
|
0
|
0
|
0
|
|
|
|
confess "argument must be HASHREF" if $args and ref($args) ne 'HASH'; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
my $self = bless { }, $class; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
return $self->init( $args ); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub init { |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
0
|
1
|
|
my ($self, $args) = @_; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
0
|
|
|
|
$self->wurfl_uri( $args->{uri} || $self->default_wurfl_uri ); |
31
|
0
|
|
0
|
|
|
|
$self->wurfl_xml( $args->{xml} || $self->default_wurfl_xml ); |
32
|
0
|
|
0
|
|
|
|
$self->wurfl_bdb( $args->{bdb} || $self->default_wurfl_bdb ); |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
return $self; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
#sub default_wurfl_uri { 'http://www.nusho.it/wurfl/dl.php?t=d&f=wurfl.xml' } |
38
|
0
|
|
|
0
|
1
|
|
sub default_wurfl_uri { 'http://wurfl.sourceforge.net/wurfl.xml' } |
39
|
0
|
|
|
0
|
1
|
|
sub default_wurfl_xml { 'wurfl.xml' } |
40
|
0
|
|
|
0
|
1
|
|
sub default_wurfl_bdb { '/tmp/' } |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub wurfl_uri { |
43
|
|
|
|
|
|
|
|
44
|
0
|
0
|
|
0
|
1
|
|
$_[0]->{'wurfl_uri'} = $_[1] if @_ > 1; |
45
|
0
|
|
|
|
|
|
$_[0]->{'wurfl_uri'}; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub wurfl_xml { |
49
|
|
|
|
|
|
|
|
50
|
0
|
0
|
|
0
|
1
|
|
$_[0]->{'wurfl_xml'} = $_[1] if @_ > 1; |
51
|
0
|
|
|
|
|
|
$_[0]->{'wurfl_xml'}; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub wurfl_bdb { |
55
|
|
|
|
|
|
|
|
56
|
0
|
0
|
|
0
|
1
|
|
$_[0]->{'wurfl_bdb'} = $_[1] if @_ > 1; |
57
|
0
|
|
|
|
|
|
$_[0]->{'wurfl_bdb'}; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub error { |
61
|
|
|
|
|
|
|
|
62
|
0
|
0
|
|
0
|
0
|
|
$_[0]->{'error'} = $_[1] if @_ > 1; |
63
|
0
|
|
|
|
|
|
$_[0]->{'error'}; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub error_message { |
67
|
|
|
|
|
|
|
|
68
|
0
|
0
|
|
0
|
0
|
|
$_[0]->{'error_message'} = $_[1] if @_ > 1; |
69
|
0
|
|
|
|
|
|
$_[0]->{'error_message'}; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
1; |
74
|
|
|
|
|
|
|
__END__ |