Redis::Hash(3pm)

πŸ“¦
version 2.000 Β· 7 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ Redis::Hash ✨

okay bestie, gather round πŸ’– this is Redis::Hash(3pm), part of the User Contributed Perl Documentation, and it's literally here to let you tie your Perl hashes to Redis. yes. for real. let's go πŸ¦‹


πŸŽ€ VERSION πŸŽ€

version 2.000 β€” periodt πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

So here's the tea: this module ties a Perl hash to Redis. 🫢

But β€” and this is the plot twist β€” it does not use Redis Hashes. Nope. Instead it implements a fake hash using regular keys that look like prefix:KEY. iconic behaviour honestly 😭

And if you don't give it a prefix at all? Then it ties the entire Redis database as a hash. the whole thing. main character energy πŸ‘‘

Heads up bestie: future versions will also allow you to use real Redis hash structures. so stay tuned 🌈

🌸 SYNOPSYS 🌸

(no, we're not fixing the spelling, it's part of the vibe now πŸ’€)

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

look at that. assigning, reading, keys, values, reversing, wiping it all out with %my_hash = (). slay πŸ’…


🫢 AUTHORS 🫢

the icons who made this happen:

  • Pedro Melo <melo@cpan.org> 🌟
  • Damien Krotkine <dams@cpan.org> 🌟

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

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)

and that's the whole page, bestie πŸ’– written for perl v5.36.0, dated 2023-01-14, and shipped as Redis::Hash(3pm). go tie some hashes, you absolute legend 🧚✨

πŸ“¦ where this page comes from