Yuji Suzuki > Cache-FastMmap-Tie-0.03 > Cache::FastMmap::Tie

Download:
Cache-FastMmap-Tie-0.03.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.03   Source  

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

syntax highlighting: