The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Cache::FastMmap::Tie - Using Cache::FastMmap as hash

SYNOPSIS

        use Cache::FastMmap::Tie;
        my $fc = tie my %hash, 'Cache::FastMmap::Tie', (
                share_file => "file_name",
                cache_size => "1k",
                expire_time=> "10m",
        );

        $hash{ABC} = 'abc'; # $fc->set('ABC', 'abc');
        $hash{abc_def} = [qw(ABC DEF)];
        $hash{xyz_XYZ} = {aaa=>'AAA',BBB=>[qw(ccc DDD),{eee=>'FFF'}],xxx=>'YYY'};

        print $hash{ABC}; # $fc->get('ABC');

        for ( keys %hash ) { # $fc->get_keys(0);
                print $hash{$_}, "\n"; # $fc->get($_);
        }

or Basic global parameter can also be obtained from a YAML file.

        my $cf = tie my %hash, 'Cache::FastMmap::Tie', {yaml_file=>'yaml.txt'}

It is the sample of the YAML file. (yaml.txt)

        expire_time: 1m
        cache_size: 10k

DESCRIPTION

Tie for Cache::FastMmap. Read `perldoc perltie`

AUTHOR

Yuji Suzuki <yuji.suzuki.perl@gmail.com>

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

Cache::FastMmap