Андрій Костенко > Cache-Memcached-Tie-0.09 > Cache::Memcached::Tie

Download:
Cache-Memcached-Tie-0.09.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.09   Source  

NAME ^

Cache::Memcached::Tie - Use Cache::Memcached::Fast like a hash.

SYNOPSIS ^

    #!/usr/bin/perl -w
    use strict;
    use Cache::Memcached::Tie;
    
    my %hash;
    my $default_expiration_in_seconds = 60;
    my $memd = tie %hash,'Cache::Memcached::Tie', $default_expiration_in_seconds, {servers=>['192.168.0.77:11211']};
    $hash{b} = ['a', { b => 'a' }];
    print $hash{'a'};
    print $memd->memd->get('b');
    # Clears all data
    %hash = ()

    #Also we can work with a slices:
    @hash{ 'a' .. 'z' } = ( 1 .. 26 );
    print join ',', @hash{ 'a' .. 'e' }; 

DESCRIPTION ^

Memcached works like big dictionary... So why we can't use it as Perl hash?

AUTHOR ^

Andrii Kostenko <andrey@kostenko.name>

COPYRIGHT AND LICENSE ^

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

syntax highlighting: