Hi, For some reason I cannot get Cache::Memcached::Fast to work with arrays. Arrays of hashes work okay, but arrays them selves do not. Scalars are also ok. Doesn't work, as per online documentation:
use Cache::Memcached::Fast; $memd = new Cache::Memcached::Fast({ servers => [ { address => 'localhost:11211', weight => 2.5 } ], namespace => 'abc:', connect_timeout => 0.2, io_timeout => 1.0, close_on_error => 1, compress_threshold => 100_000, compress_ratio => 0.9, compress_algo => 'deflate', max_failures => 3, failure_timeout => 2, ketama_points => 100, nowait => 0, serialize_methods => [ \&Storable::freeze, \&Storable::thaw ], utf8 => ($^V >= 5.008001 ? 1 : 0), }); $memd->flush_all; @array = (1,2,3,4); $memd->set("mem_id_cache",\@array); @tmp = $memd->get("mem_id_cache"); foreach (@tmp){ print $_; }
All it does is print ARRAY(0x1b316c0)ARRAY(0x1e82f48)ARRAY(0x19913a0) If I inspect what was actually stored in memcache:
telnet localhost 11211 get abc: mem_id_cache VALUE abc:mem_id_cache 1 32 + + 12345678 1 2 3 4 END
Help on this is much appreciated.

In reply to Memcached and arrays? by expresspotato

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.