line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::QRCode; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
437
|
use Text::QRCode; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use Carp; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
|
|
|
|
|
|
my ( $class, %args ) = @_; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
bless { |
14
|
|
|
|
|
|
|
text_qrcode => Text::QRCode->new, |
15
|
|
|
|
|
|
|
white => 'white', |
16
|
|
|
|
|
|
|
black => 'black', |
17
|
|
|
|
|
|
|
%args |
18
|
|
|
|
|
|
|
}, $class; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub plot { |
22
|
|
|
|
|
|
|
my ( $self, $text ) = @_; |
23
|
|
|
|
|
|
|
croak 'Not enough arguments for plot()' unless $text; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my $arref = $self->{text_qrcode}->plot($text); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my ($white, $black) = ($self->{white}, $self->{black}); |
28
|
|
|
|
|
|
|
my $w = " | "; |
29
|
|
|
|
|
|
|
my $b = " | "; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my $html |
32
|
|
|
|
|
|
|
.= '';
33
|
|
|
|
|
|
|
$html |
34
|
|
|
|
|
|
|
.= ' | '
35
|
|
|
|
|
|
|
. join( '', map { $_ eq '*' ? $b : $w } @$_ ) . ' | '
36
|
|
|
|
|
|
|
for (@$arref); |
37
|
|
|
|
|
|
|
$html .= ' | '; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
return $html; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
__END__ |