Redis:...t::List(3pm)
β¨ NAME β¨
okay so bestie, this one's from the User Contributed Perl Documentation, and it's a whole lil treasure: Redis::Fast::List β tie Perl arrays to Redis lists π
like. your regular Perl array? but it's lowkey living in Redis. the way that just works?? obsessed. π
β¨ SYNOPSYS β¨
tie @my_list, 'Redis::Fast::List', 'list_name', @Redis_new_parameters;
$value = $my_list[$index];
$my_list[$index] = $value;
$count = @my_list;
push @my_list, 'values';
$value = pop @my_list;
unshift @my_list, 'values';
$value = shift @my_list;
## NOTE: fourth parameter of splice is *NOT* supported for now
@other_list = splice(@my_list, 2, 3);
@my_list = ();
πΈ the vibe check πΈ
you tie a normal Perl array to it, hand it a list name, hand it your @Redis_new_parameters, and boom β the array is now riding on Redis. β¨
here's the whole menu of moves, fr fr:
tie @my_list, 'Redis::Fast::List', 'list_name', @Redis_new_parameters;β bind the array, name the list, pass your Redis params. that's the whole setup, no cap. π«Ά$value = $my_list[$index];β grab a value by index. π$my_list[$index] = $value;β set a value by index. iconic. β¨$count = @my_list;β how many things are in there. π¦push @my_list, 'values';β push time.$value = pop @my_list;β pop time, and you get the value back.unshift @my_list, 'values';β unshift time.$value = shift @my_list;β shift time, value returned to you.@other_list = splice(@my_list, 2, 3);β splice, BUT read the warning below bestie, seriously.@my_list = ();β clear the whole thing out. π§
β οΈ NOTE: the fourth parameter ofspliceis NOT supported for now. keep it to@other_list = splice(@my_list, 2, 3);and don't come for me when the 4th arg does nothing. π
that's literally it. tie the array, use it like an array, let Redis hold it. main character energy only. π
mwah π this lil page came from the User Contributed Perl Documentation for Redis:...t::List(3pm), built on perl v5.42.3, dated 2026-08-20. slay, go forth and tie responsibly. π
π¦ where this page comes from
- ubuntu stonking: libredis-fast-perl 0.37+dfsg-1build2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms