line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Catalyst::Plugin::Cache::Backend::FastMmap; |
4
|
1
|
|
|
1
|
|
63005
|
use base qw/Cache::FastMmap/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1103
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
9712
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
34
|
|
7
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
224
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# wrap everything in a scalar ref so that we can store plain scalars as well |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub get { |
12
|
2
|
|
|
2
|
1
|
922
|
my ( $self, $key ) = @_; |
13
|
2
|
50
|
|
|
|
3
|
${ $self->SUPER::get($key) || return }; |
|
2
|
|
|
|
|
14
|
|
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub set { |
17
|
2
|
|
|
2
|
1
|
60461
|
my ( $self, $key, $value ) = @_; |
18
|
2
|
|
|
|
|
23
|
$self->SUPER::set( $key => \$value ); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
__PACKAGE__; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
__END__ |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=pod |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 NAME |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
Catalyst::Plugin::Cache::Backend::FastMmap - A thin wrapper for |
30
|
|
|
|
|
|
|
L<Cache::FastMmap> that can handle non refs. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 SYNOPSIS |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
use Catalyst::Plugin::Cache::Backend::FastMmap; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
my $cache_obj = Catalyst::Plugin::Cache::Backend::FastMmap->new; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
$cache_obj->set( key => [qw/blah blah blah/] ); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
$cache_obj->set( key => "this_works_too" ); # non references can also be stored |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 DESCRIPTION |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=cut |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|