Changes between Version 2 and Version 3 of jazz/11-02-15


Ignore:
Timestamp:
Feb 16, 2011, 8:46:40 AM (14 years ago)
Author:
jazz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • jazz/11-02-15

    v2 v3  
    11= 2011-02-15 =
     2
     3== memcached, PHP & Perl ==
    24
    35{{{
     
    68
    79 * [http://code.google.com/p/memcache-top/ memcache-top] - 可以當成是 memcached perl 的範例
     10
     11 * [http://miltonkeynes.pm.org/talks/2009/01/colin_bradford_memcached.pdf Memcached and Perl] (PDF)
     12{{{
     13#!perl
     14use Cache::Memcached;
     15#Connect
     16my $cache = Cache::Memcached->new(servers => [ “10.0.0.1:11211”,
     17“10.0.0.2:11211” ]);
     18# Set some data - $data can be a ref, as long as Storable can nfreeze it
     19$cache->set($key, $data, 3600); # 1 hour expiry
     20# Get the data back
     21my $x = $cache->get($key);
     22# or get multiple pieces simultaneously
     23my $hashref = $cache->get_multi($key1, $key2, $key3);
     24}}}