<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>张经纬的博客 &#187; Perl</title>
	<atom:link href="http://www.zhangjingwei.com/archives/category/perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zhangjingwei.com</link>
	<description></description>
	<lastBuildDate>Thu, 09 Feb 2012 03:44:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Luhn 算法的Perl实现</title>
		<link>http://www.zhangjingwei.com/archives/perl-luhn/</link>
		<comments>http://www.zhangjingwei.com/archives/perl-luhn/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 17:09:32 +0000</pubDate>
		<dc:creator>张经纬</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[Luhn]]></category>

		<guid isPermaLink="false">http://www.zhangjingwei.com/?p=1341</guid>
		<description><![CDATA[Luhn 算法主要应用在校键数字卡号的合法性，例如我们常见的银行卡，信用卡，ICCID号等等。 Luhn 算法简单的说，既从低位开始，基数位相加的和，与处理过的（将当前偶数位数字×2，若结果大于9，则将2位数字相加得到个位数，若结果小于等于9，直接记录这个值）偶数位相加的和的总和，若可被10整除，则合法，反之则不合法。 算法如下： #!/usr/bin/perl use strict; use warnings; &#160; #定义一个卡号 my $cardNum = &#34;4367421590502289184&#34;; &#160; sub luhnCheckNum&#123; my $oddSum = 0; my $evenSum = 0; my $isOdd = 1; for&#40;my $i=length&#40;$_&#91;0&#93;&#41;-1; $i&#62;=0; $i--&#41;&#123; my $iNum = substr&#40;$_&#91;0&#93;,$i,1&#41;; if&#40;$isOdd&#41;&#123; $oddSum += $iNum; &#125;else&#123; $iNum = $iNum*2; if&#40;$iNum&#62;9&#41;&#123; my @iNumArry = split&#40;//, $iNum&#41;; $iNum = [...]]]></description>
		<wfw:commentRss>http://www.zhangjingwei.com/archives/perl-luhn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl 压缩 Js</title>
		<link>http://www.zhangjingwei.com/archives/perl-compression-js/</link>
		<comments>http://www.zhangjingwei.com/archives/perl-compression-js/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 10:54:09 +0000</pubDate>
		<dc:creator>张经纬</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[正则]]></category>

		<guid isPermaLink="false">http://www.zhangjingwei.com/?p=1335</guid>
		<description><![CDATA[sub compress &#123; my &#40;$codevalue&#41;=@_; $codevalue =~ s/不支持Flash//; $codevalue =~ s/^\s+//; $codevalue =~ s/&#60;!--(.*?)--&#62;//g; $codevalue =~ s/(http&#124;https):\/\//$1:~~/g; $codevalue =~ s/\s*\/\/.*?\n/\n/g; $codevalue =~ s/(http&#124;https):~~/$1:\/\//g; $codevalue =~ s/(^&#124; &#124;\t)\/\/.*$//g; $codevalue =~ s!/\*.*?\*/\s*!!sg; $codevalue =~ s/(;&#124;\n)\t+/$1/g; $codevalue =~ s/\n{2,}/\n/g; $codevalue =~ s/(if&#124;else)\s*(\(.*?\))?\s*([\w\{])/$1$2$3/sg; $codevalue =~ s/[ \t]*([\=\,\+\-\*\&#38;\&#124;\:\?\&#60; \&#62;\{\}\(\)\[\]]+)[ \t]*/$1/g; $codevalue =~ s/^\s*\n//mg; $codevalue =~ s/(;)\s*/$1/g; $codevalue =~ s/(\r\n&#124;\n)//g; $codevalue [...]]]></description>
		<wfw:commentRss>http://www.zhangjingwei.com/archives/perl-compression-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>读取数据库查询结果条数</title>
		<link>http://www.zhangjingwei.com/archives/%e8%af%bb%e5%8f%96%e6%95%b0%e6%8d%ae%e5%ba%93%e6%9f%a5%e8%af%a2%e7%bb%93%e6%9e%9c%e6%9d%a1%e6%95%b0/</link>
		<comments>http://www.zhangjingwei.com/archives/%e8%af%bb%e5%8f%96%e6%95%b0%e6%8d%ae%e5%ba%93%e6%9f%a5%e8%af%a2%e7%bb%93%e6%9e%9c%e6%9d%a1%e6%95%b0/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 04:07:35 +0000</pubDate>
		<dc:creator>张经纬</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://www.zhangjingwei.com/?p=1230</guid>
		<description><![CDATA[使用perl查询数据库后，用如下方法读取数据库查询结果条数。 my $sth=&#38;execsql&#40;$dbh,&#34;select * from DB&#34;&#41;; my $rc = $sth-&#62;rows; print $rc;]]></description>
		<wfw:commentRss>http://www.zhangjingwei.com/archives/%e8%af%bb%e5%8f%96%e6%95%b0%e6%8d%ae%e5%ba%93%e6%9f%a5%e8%af%a2%e7%bb%93%e6%9e%9c%e6%9d%a1%e6%95%b0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>标量转数组</title>
		<link>http://www.zhangjingwei.com/archives/%e6%a0%87%e9%87%8f%e8%bd%ac%e6%95%b0%e7%bb%84/</link>
		<comments>http://www.zhangjingwei.com/archives/%e6%a0%87%e9%87%8f%e8%bd%ac%e6%95%b0%e7%bb%84/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 10:42:51 +0000</pubDate>
		<dc:creator>张经纬</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://www.zhangjingwei.com/?p=1223</guid>
		<description><![CDATA[#标量转数组 $ckVal = '标-量-转-数-组-函-数'; $pattern='-'; @categories = split&#40;/-/, $ckVal&#41;; 利用split函数将标量分割后压入数组。既可用$ary[index]，取得对应的值。]]></description>
		<wfw:commentRss>http://www.zhangjingwei.com/archives/%e6%a0%87%e9%87%8f%e8%bd%ac%e6%95%b0%e7%bb%84/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

