use strict;
use warnings;
use Carp;
-use Clone qw( clone );
+use Storable qw(dclone);
use Module::Load::Conditional qw(can_load);
use Koha::Cache::Object;
my $set_sub = $self->{ref($self->{$cache}) . "_set"};
# Deep copy if it's not a scalar and unsafe is not passed
- $value = clone( $value ) if ref($value) and not $unsafe;
+ $value = dclone( $value ) if ref($value) and not $unsafe;
# Set in L1 cache
$L1_cache{ $key } = $value;
# Or if we do not need to deep copy
return $L1_cache{$key}
if not ref $L1_cache{$key} or $unsafe;
- return clone $L1_cache{$key};
+ return dclone $L1_cache{$key};
}
my $get_sub = $self->{ref($self->{$cache}) . "_get"};
# Otherwise the L1 cache won't ever be populated
$L1_cache{$key} = $value;
- $value = clone $value if ref $L1_cache{$key} and not $unsafe;
+ $value = dclone $value if ref $L1_cache{$key} and not $unsafe;
return $value;
}