line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::ReplacePictogramMobileJp; |
2
|
3
|
|
|
3
|
|
124997
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
122
|
|
3
|
3
|
|
|
3
|
|
18
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
139
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.07'; |
5
|
3
|
|
|
3
|
|
23777
|
use Params::Validate ':all'; |
|
3
|
|
|
|
|
84187
|
|
|
3
|
|
|
|
|
812
|
|
6
|
3
|
|
|
3
|
|
2501
|
use HTML::ReplacePictogramMobileJp::DoCoMo; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use HTML::ReplacePictogramMobileJp::EZweb; |
8
|
|
|
|
|
|
|
use HTML::ReplacePictogramMobileJp::Vodafone; |
9
|
|
|
|
|
|
|
use HTML::ReplacePictogramMobileJp::AirHPhone; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my $long_name_for = +{ |
12
|
|
|
|
|
|
|
I => 'DoCoMo', |
13
|
|
|
|
|
|
|
E => 'EZweb', |
14
|
|
|
|
|
|
|
V => 'Vodafone', |
15
|
|
|
|
|
|
|
H => 'AirHPhone', |
16
|
|
|
|
|
|
|
}; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub replace { |
19
|
|
|
|
|
|
|
my $class = shift; |
20
|
|
|
|
|
|
|
validate( |
21
|
|
|
|
|
|
|
@_, |
22
|
|
|
|
|
|
|
+{ |
23
|
|
|
|
|
|
|
carrier => qr{^[IEVH]$}, |
24
|
|
|
|
|
|
|
charset => qr{^(?:utf-?8|sjis)$}i, |
25
|
|
|
|
|
|
|
callback => +{ type => CODEREF }, |
26
|
|
|
|
|
|
|
html => +{ type => SCALAR }, |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
my %args = @_; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my $klass = join "::", __PACKAGE__, $long_name_for->{$args{carrier}}; |
32
|
|
|
|
|
|
|
my $method = $args{charset} =~ /^utf-?8$/i ? 'utf8' : 'sjis'; |
33
|
|
|
|
|
|
|
$klass->$method(html => $args{html}, callback => $args{callback}); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
__END__ |