line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::String::CRC32; |
2
|
3
|
|
|
3
|
|
93673
|
use 5.008001; |
|
3
|
|
|
|
|
10
|
|
3
|
3
|
|
|
3
|
|
16
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
55
|
|
4
|
3
|
|
|
3
|
|
12
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
153
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = "0.02"; |
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
16
|
use base qw(Template::Plugin); |
|
3
|
|
|
|
|
15
|
|
|
3
|
|
|
|
|
884
|
|
9
|
3
|
|
|
3
|
|
7557
|
use Template::Plugin; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
60
|
|
10
|
3
|
|
|
3
|
|
655
|
use Template::Stash; |
|
3
|
|
|
|
|
26005
|
|
|
3
|
|
|
|
|
93
|
|
11
|
3
|
|
|
3
|
|
768
|
use String::CRC32; |
|
3
|
|
|
|
|
1482
|
|
|
3
|
|
|
|
|
490
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
$Template::Stash::SCALAR_OPS->{'crc32'} = \&_crc32; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new { |
16
|
3
|
|
|
3
|
1
|
9713
|
my ($class, $context, $options) = @_; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# now define the filter and return the plugin |
19
|
3
|
|
|
|
|
15
|
$context->define_filter('crc32', \&_crc32); |
20
|
3
|
|
|
|
|
86
|
return bless {}, $class; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub _crc32 { |
24
|
9
|
50
|
|
9
|
|
326
|
my $options = ref $_[-1] eq 'HASH' ? pop : {}; |
25
|
9
|
|
|
|
|
67
|
return crc32(join('', @_)); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
__END__ |