<?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>Notes &#187; perl</title>
	<atom:link href="http://alexpb.com/notes/articles/category/programming/perl-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://alexpb.com/notes</link>
	<description></description>
	<lastBuildDate>Tue, 27 Dec 2011 13:04:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Perl CGI</title>
		<link>http://alexpb.com/notes/articles/2010/10/12/perl-cgi/</link>
		<comments>http://alexpb.com/notes/articles/2010/10/12/perl-cgi/#comments</comments>
		<pubDate>Wed, 13 Oct 2010 00:35:51 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://alexpb.com/notes/?p=890</guid>
		<description><![CDATA[PSGI Plack Plack::Middleware::StackTrace]]></description>
			<content:encoded><![CDATA[<p><a href="http://search.cpan.org/~miyagawa/PSGI-1.03/PSGI.pod">PSGI</a></p>
<p><a href="http://search.cpan.org/~miyagawa/Plack-0.9950/lib/Plack.pm">Plack</a></p>
<p><a href="http://search.cpan.org/~miyagawa/Plack-0.9950/lib/Plack/Middleware/StackTrace.pm">Plack::Middleware::StackTrace</a></p>
]]></content:encoded>
			<wfw:commentRss>http://alexpb.com/notes/articles/2010/10/12/perl-cgi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excel Deletes Leading 0s When Opening a CSV File</title>
		<link>http://alexpb.com/notes/articles/2010/07/01/excel-deletes-leading-0s-when-opening-a-csv-file/</link>
		<comments>http://alexpb.com/notes/articles/2010/07/01/excel-deletes-leading-0s-when-opening-a-csv-file/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 21:43:30 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[excel]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[zero]]></category>

		<guid isPermaLink="false">http://alexpb.com/notes/?p=746</guid>
		<description><![CDATA[If you want Excel to keep a field&#8217;s leading zeros when opening a CSV file using Excel, you can change it to =&#8221;value&#8221;. For example, if you have a row with 4 values that looks like this: Just change it to:]]></description>
			<content:encoded><![CDATA[<p>If you want Excel to keep a field&#8217;s leading zeros when opening a CSV file using Excel, you can change it to =&#8221;value&#8221;.</p>
<p>For example, if you have a row with 4 values that looks like this:</p>
<pre class="brush: plain; title: ; notranslate">test,00016102,test,test</pre>
<p></p>
<p>Just change it to:</p>
<pre class="brush: plain; title: ; notranslate">test,=&quot;00016102&quot;,test,test</pre>
]]></content:encoded>
			<wfw:commentRss>http://alexpb.com/notes/articles/2010/07/01/excel-deletes-leading-0s-when-opening-a-csv-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use Perl&#8217;s ternary operator</title>
		<link>http://alexpb.com/notes/articles/2009/07/06/how-to-use-perl-ternary-operator/</link>
		<comments>http://alexpb.com/notes/articles/2009/07/06/how-to-use-perl-ternary-operator/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 03:46:21 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://alexpb.com/notes/?p=625</guid>
		<description><![CDATA[The Ternary Operator The ternary is actually a sequence of operators. The operator is used like this: CONDITION-PART ? TRUE-PART : FALSE-PART which is shorthand for the following statement: if (CONDITION-PART) { TRUE-PART } else { FALSE-PART } Example: If $firstVar is zero, then assign $secondVar a value of zero. Otherwise, assign $secondVar the value [...]]]></description>
			<content:encoded><![CDATA[<p>The Ternary Operator</p>
<p>The ternary is actually a sequence of operators. The operator is used like this:</p>
<p>    CONDITION-PART ? TRUE-PART : FALSE-PART</p>
<p>which is shorthand for the following statement:</p>
<p>    if (CONDITION-PART) {</p>
<p>        TRUE-PART</p>
<p>    } else {</p>
<p>        FALSE-PART</p>
<p>    }</p>
<p> Example:     If $firstVar is zero, then assign $secondVar a value of zero. Otherwise, assign $secondVar the value in the first element in the array @array. </p>
<p><code>$secondVar = ($firstVar == 0) ? 0 : $array[0];</code></p>
<p>via <a href="http://www.webbasedprogramming.com/Perl-5-By-Example/ch4.htm#TheTernaryOperator">Perl 5 By Example</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexpb.com/notes/articles/2009/07/06/how-to-use-perl-ternary-operator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check String for Non-ASCII Characters in Perl</title>
		<link>http://alexpb.com/notes/articles/2008/11/01/check-string-for-non-ascii-characters-in-perl/</link>
		<comments>http://alexpb.com/notes/articles/2008/11/01/check-string-for-non-ascii-characters-in-perl/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 20:19:21 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ascii]]></category>
		<category><![CDATA[byte string]]></category>
		<category><![CDATA[pure]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[valid]]></category>

		<guid isPermaLink="false">http://alexpb.com/notes/?p=263</guid>
		<description><![CDATA[if ( $string =~ /[[:^ascii:]]/ ) { print "String contains characters that are NOT pure ASCII"; } else { print "Everything is good, string/pure is valid ASCII."; } E.G.: If it contains bytes > 127, it&#8217;s not valid ASCII.]]></description>
			<content:encoded><![CDATA[<p><code><br />
if ( $string =~ /[[:^ascii:]]/ ) {<br />
   print "String contains characters that are NOT pure ASCII";<br />
}<br />
else {<br />
  print "Everything is good, string/pure is valid ASCII.";<br />
}<br />
</code></p>
<p>E.G.: If it contains bytes > 127, it&#8217;s not valid ASCII. </p>
]]></content:encoded>
			<wfw:commentRss>http://alexpb.com/notes/articles/2008/11/01/check-string-for-non-ascii-characters-in-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Active Perl&#8217;s Package Manager: ppm</title>
		<link>http://alexpb.com/notes/articles/2008/08/06/active-perls-package-manager-ppm/</link>
		<comments>http://alexpb.com/notes/articles/2008/08/06/active-perls-package-manager-ppm/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 02:06:54 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[slackware]]></category>

		<guid isPermaLink="false">http://alexpb.com/notes/?p=138</guid>
		<description><![CDATA[It allows you to get Perl pre-compiled packages. You can avoid installing a C compiler which is needed for some packages (KinoSearch for example). http://aspn.activestate.com/ASPN/Downloads/ActivePerl/PPM/ Alternate packages repositories: http://cpan.uwinnipeg.ca/PPMPackages/10xx/]]></description>
			<content:encoded><![CDATA[<p>It allows you to get Perl pre-compiled packages. You can avoid installing a C compiler which is needed for some packages (KinoSearch for example).</p>
<p><a href="http://aspn.activestate.com/ASPN/Downloads/ActivePerl/PPM/">http://aspn.activestate.com/ASPN/Downloads/ActivePerl/PPM/</a></p>
<p>Alternate packages repositories:<br />
<a href="http://cpan.uwinnipeg.ca/PPMPackages/10xx/">http://cpan.uwinnipeg.ca/PPMPackages/10xx/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://alexpb.com/notes/articles/2008/08/06/active-perls-package-manager-ppm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl&#8217;s KinoSearch vs Plucene</title>
		<link>http://alexpb.com/notes/articles/2008/07/17/perls-kinosearch-vs-plucene/</link>
		<comments>http://alexpb.com/notes/articles/2008/07/17/perls-kinosearch-vs-plucene/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 02:33:59 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://alexpb.com/notes/?p=125</guid>
		<description><![CDATA[KinoSearch is the winner The following perl scripts index *.txt in the current folder and search for &#8220;TEST&#8221;. The first one is using Perl&#8217;s KinoSearch module and the other one is using Plucene. KinoSearch is alot faster then Plucene and also gives better results. (right click to download) KinoSearch.pl Plucene.pl]]></description>
			<content:encoded><![CDATA[<h3>KinoSearch is the winner</h3>
<p>The following perl scripts index *.txt in the current folder and search for &#8220;TEST&#8221;.  The first one is using Perl&#8217;s KinoSearch module and the other one is using Plucene.  KinoSearch is alot faster then Plucene and also gives better results.</p>
<p></p>
<p>(right click to download)</p>
<p><a href='http://alexpb.com/notes/wp-content/uploads/2008/07/kinosearch.pl'>KinoSearch.pl</a></p>
<p><a href='http://alexpb.com/notes/wp-content/uploads/2008/07/plucenesearch.pl'>Plucene.pl</a></p>
]]></content:encoded>
			<wfw:commentRss>http://alexpb.com/notes/articles/2008/07/17/perls-kinosearch-vs-plucene/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install a Perl Module on a Shared Host</title>
		<link>http://alexpb.com/notes/articles/2007/09/25/installing-perl-module-on-a-shared-host/</link>
		<comments>http://alexpb.com/notes/articles/2007/09/25/installing-perl-module-on-a-shared-host/#comments</comments>
		<pubDate>Tue, 25 Sep 2007 21:16:26 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://alexpb.com/notes/articles/2007/09/25/installing-perl-module-on-a-shared-host/</guid>
		<description><![CDATA[Setup cpan: Set the following settings: Get and Install the Module Automatically Make sure Perl can find your modules Add this line in each of your Perl scripts (change perl version accordingly): OR rather than editing all your Perl scripts, in your cgi-bin/.htaccess file: OR in your .bash_profile: It won&#8217;t be effective until you log [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li>Setup cpan:</li>
<pre class="brush: plain; title: ; notranslate">$ mkdir ~/perl
$ mkdir -p ~/.cpan/CPAN
$ touch ~/.cpan/CPAN/MyConfig.pm
$ cpan</pre>
<pre class="brush: plain; title: ; notranslate">cpan&gt; o conf init</pre>
<p>Set the following settings:</p>
<pre class="brush: plain; title: ; notranslate">'cpan_home' =&gt; q[/home/username/.cpan],
'build_dir' =&gt; q[/home/username/.cpan/build]
'keep_source_where' =&gt; q[/home/username/.cpan/sources],
'makepl_arg' =&gt; q[PREFIX=~/perl]
'mbuildpl_arg' =&gt; q[--install_base /home/username]
</pre>
<li>Get and Install the Module
<ul>
<li><strong>Automatically</strong>
<ul>
<li>
<pre class="brush: plain; title: ; notranslate">$ cpan force install Module::Name</pre>
</li>
</ul>
</li>
</ul>
</li>
<li>Make sure Perl can find your modules</li>
<p>Add this line in each of your Perl scripts (change perl version accordingly):</p>
<pre class="brush: plain; title: ; notranslate">use lib '/home/your_username/perl/lib/perl5/site_perl/5.8.7';</pre>
<p>OR rather than editing all your Perl scripts, in your cgi-bin/.htaccess file:</p>
<pre class="brush: plain; title: ; notranslate">SetEnvIf  Request_URI  &quot;^/cgi-bin/&quot; PERL5LIB=/home/user/perl/lib/perl5/site_perl/5.8.7:/home/user/perl/lib/perl5/site_perl/5.8.7/site_perl</pre>
<p>OR in your .bash_profile:</p>
<pre class="brush: plain; title: ; notranslate">export PERL5LIB=/home/user/perl/lib/perl5/site_perl/5.8.7:/home/user/perl/lib:/home/user/perl/lib/perl5:/home/user/perl/lib/perl5/site_perl</pre>
<p>It won&#8217;t be effective until you log back in, if you want to make it effective in your current session, just type that line in your command prompt.</ol>
]]></content:encoded>
			<wfw:commentRss>http://alexpb.com/notes/articles/2007/09/25/installing-perl-module-on-a-shared-host/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

