<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[perl memcache-add_multi ]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Tue, 17 Aug 2010 05:39:19 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	<br/><div class="code">#!perl<br/>use strict;<br/>use Cache::Memcached::Fast;<br/><br/> <br/><br/>sub getConfig&#123;<br/><br/> return &#91;&quot;xx.xx.xx.201:11211&quot;,&quot;xx.xx.xx.203:11211&quot;,&quot;xx.xx.xx.204:11211&quot;,&quot;xx.xx.xx.205:11211&quot;,&quot;xx.xx.xx.206:11211&quot;,&quot;xx.xx.xx.207:11211&quot;,&quot;xx.xx.xx.208:11211&quot;,&quot;xx.xx.xx.218:11211&quot;,&quot;xx.xx.xx.235:11211&quot;,&quot;xx.xx.xx.236:11211&quot;,&quot;xx.xx.xx.237:11211&quot;,&quot;xx.xx.xx.238:11211&quot;,&quot;xx.xx.xx.239:11211&quot;,&quot;xx.xx.xx.240:11211&quot;&#93;;<br/><br/>&#125;<br/><br/>my $memcached ;<br/>my $expires = 1800;<br/>my $memcached =Cache::Memcached::Fast-&gt;new(&#123; servers =&gt;getConfig(), ketama_points =&gt; 151&#125;);<br/><br/>my @addMutiKeys=();<br/>my @addMutiExipres=();<br/>my @addMutiValues=();<br/>my $addMultiStr=&quot;&quot;;<br/> my $split=&quot;&quot;;<br/>for ( my $i = 0 ; $i &lt; 10000 ; $i++ ) &#123;<br/> my $index=$i;<br/> push(@addMutiKeys,&quot;myn_key_&quot;.$index); <br/> push(@addMutiValues,&quot;myn_value_&quot;.$index); <br/> push(@addMutiExipres,3600); <br/> $addMultiStr=$addMultiStr.$split.&quot;&#91;&#92;&quot;&quot;.&quot;myn_key_&quot;.$index.&quot;&#92;&quot;,&#92;&quot;1&#92;&quot;,3600&#93;&quot;;<br/>&nbsp;&nbsp;$split=&quot;,&quot;;<br/> <br/>&#125;<br/>#my $hashKeys=$memcached-&gt;add_multi(&#91;&quot;aaa&quot;,&quot;111&quot;,3600&#93;,&#91;&quot;bbb&quot;,&quot;222&quot;,3600&#93;);<br/>#my $hashKeys=$memcached-&gt;add_multi(map &#123; &#91;$addMutiKeys&#91;$_&#93;, &quot;aa&quot;&#93; &#125; @addMutiValues);<br/>#$hashKeys=$memcached-&gt;get_multi(@addMutiKeys);<br/>my $hashKeys;<br/>my $evalStr=&quot;return &#92;$memcached-&gt;add_multi($addMultiStr);&quot;;<br/>$hashKeys=eval($evalStr);<br/><br/>my $i=0;<br/>for($i=0;$i&lt;@addMutiKeys;$i++)<br/>&#123;<br/> #print $addMutiKeys&#91;$i&#93;.&quot;&#92;n&quot;;<br/>&#125;<br/><br/>my $ekey;<br/>foreach $ekey (keys(%$hashKeys))<br/>&#123;<br/> print &quot;key=&quot;.$ekey.&quot;&#91;&quot;.$$hashKeys&#123;$ekey&#125;.&quot;&#93;&#92;n&quot;;<br/>&#125;<br/><br/><br/>$memcached-&gt;disconnect_all();</div>
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] perl memcache-add_multi ]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>