in reply to Memcached and arrays?
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Memcached and arrays?
by BrowserUk (Patriarch) on Jan 21, 2010 at 05:59 UTC | |
by ikegami (Patriarch) on Jan 21, 2010 at 06:17 UTC | |
by expresspotato (Beadle) on Jan 21, 2010 at 06:05 UTC | |
by BrowserUk (Patriarch) on Jan 21, 2010 at 06:13 UTC | |
|
Re^2: Memcached and arrays?
by expresspotato (Beadle) on Jan 21, 2010 at 06:03 UTC | |
by ikegami (Patriarch) on Jan 21, 2010 at 06:22 UTC |