If you're having a problem, stop hiding the diagnostics. Use use strict; use warnings;! They wouldn't have helped here (except to detect unrelated issues), but you didn't know that.
I love how you repeat that it works for arrays and it doesn't work for arrays. The problem is surely in the question.
Your code is equally fishy.
$memd->set("mem_id_cache", \@array); ^^^^^^^ scalar @tmp = $memd->get("mem_id_cache"); ^^^^ array
Why do you expect to get something different than you put in?
Storing @array yeilds nothing.
I'm curious as to how you tested that since functions can only take scalars as arguments.
Passing the contents of the array is obviously wrong too, since the documentation that says you must supply *a* scalar for the value.
Since you can't change what you store, you need to change what you expect to fetch.
my @items_to_stored = qw( a b c ); $memd->set("mem_id_cache", \@items_to_stored); my $stored_items = $memd->get("mem_id_cache"); print "$_\n" for @$stored_items;
In reply to Re: Memcached and arrays?
by ikegami
in thread Memcached and arrays?
by expresspotato
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |