Group
Extension

Matches 1

Cache-File-Simple ( B/BA/BAKERSCOT/Cache-File-Simple-0.1.tar.gz, BAKERSCOT, 2025; MetaCPAN )
Cache-File-Simple/lib/Cache/File/Simple.pm ( view source; MetaCPAN )
mple;

use Exporter 'import';
our @EXPORT = qw(cache);

use strict;
use warnings;
use v5.16;

use JSON::PP;
use Tie::File;
use File::Path;
use Digest::SHA qw(sha256_hex);
use File::Basename;

our $CAC
$key || "");
	my $dir  = "$CACHE_ROOT/perl-cache/" . substr($hash, 0, 3);
	my $file = "$dir/$hash.json";
	mkpath($dir);

	tie @data, 'Tie::File', $file or die("Unable to write $file"); # to r/w file

XPIRE;
		$data[0]    = encode_json({ expires => $expires, data => $val, key => $key });
		$ret        = 1;
	} elsif ($key && -r $file) { # Get
		eval { $ret = decode_json($data[0]); };
		if ($ret->{ex

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.