---
name: "Redis::Hash"
section: "3pm"
platform: "linux"
package: "libredis-perl"
version: "2:2.000-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Redis::Hash"
---

# Redis::Hash(3pm)

tie Perl hashes to Redis hashes

## NAME

Redis::Hash - tie Perl hashes to Redis hashes

## VERSION

version 2.000

## 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.

## 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 = ();
```

## AUTHORS

- •

  Pedro Melo \<melo@cpan.org\>

- •

  Damien Krotkine \<dams@cpan.org\>

## COPYRIGHT AND LICENSE

This software is Copyright (c) 2015 by Pedro Melo, Damien Krotkine.

This is free software, licensed under:

```
  The Artistic License 2.0 (GPL Compatible)
```
