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 $_; } #### telnet localhost 11211 get abc: mem_id_cache VALUE abc:mem_id_cache 1 32 12345678 1 2 3 4 END