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 of splice is 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