line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::String::CRC32; |
2
|
3
|
|
|
3
|
|
111540
|
use 5.008001; |
|
3
|
|
|
|
|
15
|
|
3
|
3
|
|
|
3
|
|
22
|
use strict; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
85
|
|
4
|
3
|
|
|
3
|
|
19
|
use warnings; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
166
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = "0.03"; |
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
21
|
use base qw(Template::Plugin); |
|
3
|
|
|
|
|
22
|
|
|
3
|
|
|
|
|
1101
|
|
9
|
3
|
|
|
3
|
|
11385
|
use Template::Plugin; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
77
|
|
10
|
3
|
|
|
3
|
|
1010
|
use Template::Stash; |
|
3
|
|
|
|
|
28871
|
|
|
3
|
|
|
|
|
104
|
|
11
|
3
|
|
|
3
|
|
950
|
use String::CRC32; |
|
3
|
|
|
|
|
1575
|
|
|
3
|
|
|
|
|
568
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
$Template::Stash::SCALAR_OPS->{'crc32'} = \&_crc32; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new { |
16
|
3
|
|
|
3
|
1
|
10502
|
my ($class, $context, $options) = @_; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# now define the filter and return the plugin |
19
|
3
|
|
|
|
|
17
|
$context->define_filter('crc32', \&_crc32); |
20
|
3
|
|
|
|
|
83
|
return bless {}, $class; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub _crc32 { |
24
|
9
|
50
|
|
9
|
|
399
|
my $options = ref $_[-1] eq 'HASH' ? pop : {}; |
25
|
9
|
|
|
|
|
71
|
return crc32(join('', @_)); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
__END__ |