|
Lines 271-280
sub set_in_cache {
Link Here
|
| 271 |
# Deep copy if it's not a scalar and unsafe is not passed |
271 |
# Deep copy if it's not a scalar and unsafe is not passed |
| 272 |
$value = dclone( $value ) if ref($value) and not $unsafe; |
272 |
$value = dclone( $value ) if ref($value) and not $unsafe; |
| 273 |
|
273 |
|
| 274 |
# Set in L1 cache |
274 |
# Set in L1 cache; exit if we are caching an undef |
| 275 |
$L1_cache{ $key } = $value; |
275 |
$L1_cache{ $key } = $value; |
|
|
276 |
return if !defined $value; |
| 276 |
|
277 |
|
| 277 |
# We consider an expiry of 0 to be inifinite |
278 |
# We consider an expiry of 0 to be infinite |
| 278 |
if ( $expiry ) { |
279 |
if ( $expiry ) { |
| 279 |
return $set_sub |
280 |
return $set_sub |
| 280 |
? $set_sub->( $key, $value, $expiry ) |
281 |
? $set_sub->( $key, $value, $expiry ) |
| 281 |
- |
|
|