logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Redis::Hash - tie Perl hashes to Redis hashes

Authors

       •   Pedro Melo <melo@cpan.org>

       •   Damien Krotkine <dams@cpan.org>

Description

       Ties a Perl hash to Redis. Note that it doesn't use Redis Hashes, but implements a fake hash using
       regular keys like "prefix:KEY".

       If no "prefix" is given, it will tie the entire Redis database as a hash.

       Future versions will also allow you to use real Redis hash structures.

Name

       Redis::Hash - tie Perl hashes to Redis hashes

Synopsys

           ## Create fake hash using keys like 'hash_prefix:KEY'
           tie %my_hash, 'Redis::Hash', 'hash_prefix', @Redis_new_parameters;

           ## Treat the entire Redis database as a hash
           tie %my_hash, 'Redis::Hash', undef, @Redis_new_parameters;

           $value = $my_hash{$key};
           $my_hash{$key} = $value;

           @keys   = keys %my_hash;
           @values = values %my_hash;

           %my_hash = reverse %my_hash;

           %my_hash = ();

Version

       version 2.000

See Also