| 626 | | my ($k, $flags) = @_; |
|---|
| 627 | | |
|---|
| 628 | | # remove trailing \r\n |
|---|
| 629 | | chop $ret->{$k}; chop $ret->{$k}; |
|---|
| 630 | | |
|---|
| 631 | | $ret->{$k} = Compress::Zlib::memGunzip($ret->{$k}) |
|---|
| 632 | | if $HAVE_ZLIB && $flags & F_COMPRESS; |
|---|
| 633 | | if ($flags & F_STORABLE) { |
|---|
| 634 | | # wrapped in eval in case a perl 5.6 Storable tries to |
|---|
| 635 | | # unthaw data from a perl 5.8 Storable. (5.6 is stupid |
|---|
| 636 | | # and dies if the version number changes at all. in 5.8 |
|---|
| 637 | | # they made it only die if it unencounters a new feature) |
|---|
| 638 | | eval { |
|---|
| 639 | | $ret->{$k} = Storable::thaw($ret->{$k}); |
|---|
| 640 | | }; |
|---|
| 641 | | # so if there was a problem, just treat it as a cache miss. |
|---|
| 642 | | if ($@) { |
|---|
| 643 | | delete $ret->{$k}; |
|---|
| | 630 | my $map = $_[0]; |
|---|
| | 631 | $map = {@_} unless ref $map; |
|---|
| | 632 | |
|---|
| | 633 | while (my ($k, $flags) = each %$map) { |
|---|
| | 634 | |
|---|
| | 635 | # remove trailing \r\n |
|---|
| | 636 | chop $ret->{$k}; chop $ret->{$k}; |
|---|
| | 637 | |
|---|
| | 638 | $ret->{$k} = Compress::Zlib::memGunzip($ret->{$k}) |
|---|
| | 639 | if $HAVE_ZLIB && $flags & F_COMPRESS; |
|---|
| | 640 | if ($flags & F_STORABLE) { |
|---|
| | 641 | # wrapped in eval in case a perl 5.6 Storable tries to |
|---|
| | 642 | # unthaw data from a perl 5.8 Storable. (5.6 is stupid |
|---|
| | 643 | # and dies if the version number changes at all. in 5.8 |
|---|
| | 644 | # they made it only die if it unencounters a new feature) |
|---|
| | 645 | eval { |
|---|
| | 646 | $ret->{$k} = Storable::thaw($ret->{$k}); |
|---|
| | 647 | }; |
|---|
| | 648 | # so if there was a problem, just treat it as a cache miss. |
|---|
| | 649 | if ($@) { |
|---|
| | 650 | delete $ret->{$k}; |
|---|
| | 651 | } |
|---|