<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Perl Versus Ruby on CSV</title>
	<atom:link href="http://pthree.org/2006/12/29/perl-versus-ruby-on-csv/feed/" rel="self" type="application/rss+xml" />
	<link>http://pthree.org/2006/12/29/perl-versus-ruby-on-csv/</link>
	<description>Linux.  GNU.  Freedom.</description>
	<lastBuildDate>Wed, 08 Feb 2012 02:59:26 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha</generator>
	<item>
		<title>By: Harley Pig</title>
		<link>http://pthree.org/2006/12/29/perl-versus-ruby-on-csv/#comment-24242</link>
		<dc:creator>Harley Pig</dc:creator>
		<pubDate>Thu, 04 Jan 2007 14:45:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.pthree.org/2006/12/29/perl-versus-ruby-on-csv/#comment-24242</guid>
		<description>My server went south.  I&#039;m on a Linode and the last image they had was 2005.0 ... they&#039;ve since upgraded to 2006.1 but with all the changes the installation wasn&#039;t quite right.

I&#039;ve been working on a HowTo for Gentoo and Linode and having to re-install a bunch of times to get everything working.

It should be back up in a couple of weeks (I can&#039;t spend more than a few hours a week on it).

BTW, a preview button would be nice. :]</description>
		<content:encoded><![CDATA[<p>My server went south.  I&#8217;m on a Linode and the last image they had was 2005.0 &#8230; they&#8217;ve since upgraded to 2006.1 but with all the changes the installation wasn&#8217;t quite right.</p>
<p>I&#8217;ve been working on a HowTo for Gentoo and Linode and having to re-install a bunch of times to get everything working.</p>
<p>It should be back up in a couple of weeks (I can&#8217;t spend more than a few hours a week on it).</p>
<p>BTW, a preview button would be nice. :]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron</title>
		<link>http://pthree.org/2006/12/29/perl-versus-ruby-on-csv/#comment-24128</link>
		<dc:creator>Aaron</dc:creator>
		<pubDate>Wed, 03 Jan 2007 15:19:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.pthree.org/2006/12/29/perl-versus-ruby-on-csv/#comment-24128</guid>
		<description>phoenyx- The Perl script is reading the file line by line.

harleypig- Whatever happened to your blog, eh?</description>
		<content:encoded><![CDATA[<p>phoenyx- The Perl script is reading the file line by line.</p>
<p>harleypig- Whatever happened to your blog, eh?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harley Pig</title>
		<link>http://pthree.org/2006/12/29/perl-versus-ruby-on-csv/#comment-24126</link>
		<dc:creator>Harley Pig</dc:creator>
		<pubDate>Wed, 03 Jan 2007 14:32:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.pthree.org/2006/12/29/perl-versus-ruby-on-csv/#comment-24126</guid>
		<description>No, the construct that&#039;s being used in the perl examples is reading a line at a time.</description>
		<content:encoded><![CDATA[<p>No, the construct that&#8217;s being used in the perl examples is reading a line at a time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: phoenyx</title>
		<link>http://pthree.org/2006/12/29/perl-versus-ruby-on-csv/#comment-24070</link>
		<dc:creator>phoenyx</dc:creator>
		<pubDate>Tue, 02 Jan 2007 21:59:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.pthree.org/2006/12/29/perl-versus-ruby-on-csv/#comment-24070</guid>
		<description>The ruby version is reading the file in a line at a time, whereas it looks like the Perl version reads the whole file into memory at the beginning.  That may explain some of slowness of the ruby version.</description>
		<content:encoded><![CDATA[<p>The ruby version is reading the file in a line at a time, whereas it looks like the Perl version reads the whole file into memory at the beginning.  That may explain some of slowness of the ruby version.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harley Pig</title>
		<link>http://pthree.org/2006/12/29/perl-versus-ruby-on-csv/#comment-24042</link>
		<dc:creator>Harley Pig</dc:creator>
		<pubDate>Tue, 02 Jan 2007 15:15:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.pthree.org/2006/12/29/perl-versus-ruby-on-csv/#comment-24042</guid>
		<description>Oops ... get rid of the &#039;, $maxfields&#039; in the split command.  Since you&#039;re getting rid of a newline at the end of the line and field 182--your last field--it&#039;s apparent that you only have that many fields in your record.</description>
		<content:encoded><![CDATA[<p>Oops &#8230; get rid of the &#8216;, $maxfields&#8217; in the split command.  Since you&#8217;re getting rid of a newline at the end of the line and field 182&#8211;your last field&#8211;it&#8217;s apparent that you only have that many fields in your record.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harley Pig</title>
		<link>http://pthree.org/2006/12/29/perl-versus-ruby-on-csv/#comment-24040</link>
		<dc:creator>Harley Pig</dc:creator>
		<pubDate>Tue, 02 Jan 2007 15:11:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.pthree.org/2006/12/29/perl-versus-ruby-on-csv/#comment-24040</guid>
		<description>#!/usr/bin/perl -w

use strict;
 
open my $IN, &quot;UNIVERSE.csv&quot;;
open my $OUT, &quot;&gt;UNIVERSE_WEIGHTED.csv&quot;;

my $counter = 0;

my @names  = qw( ppp00 ppp04 pri01 pri03 pri05 pri99 );
my @fields = qw( 154   155   161   163   165   182   );

while ( &lt;$IN&gt;) {

  chomp; # This strips the newline from the line less expensively
         # than s/\n//

  if ( $counter == 1 ) {

    print $OUT &quot;$_,\&quot;weight\&quot;\n&quot;;
    next;

  }

  my %vtr;
  @vtr{ @names } = ( split /,/, $_, $maxfields )[@fields];

  $weight = 0;
  $counter++;
 
  $weight += .5 if $vtr{ &#039;ppp00&#039; } eq &#039;&quot;R&quot;&#039;);

  for ( @fields ) {

    $weight += $vtr{ $_ } eq &#039;&quot;D&quot;&#039; ? -1 :
               $vtr{ $_ } eq &#039;&quot;R&quot;&#039; ?  1 :
               0;

  }

  print $OUT &quot;$_,\&quot;$weight\&quot;\n&quot;;
  print &quot;Processed: $counter\r&quot;;

}
 
print &quot;\n&quot;;</description>
		<content:encoded><![CDATA[<p>#!/usr/bin/perl -w</p>
<p>use strict;</p>
<p>open my $IN, &#8220;UNIVERSE.csv&#8221;;<br />
open my $OUT, &#8220;&gt;UNIVERSE_WEIGHTED.csv&#8221;;</p>
<p>my $counter = 0;</p>
<p>my @names  = qw( ppp00 ppp04 pri01 pri03 pri05 pri99 );<br />
my @fields = qw( 154   155   161   163   165   182   );</p>
<p>while ( &lt;$IN&gt;) {</p>
<p>  chomp; # This strips the newline from the line less expensively<br />
         # than s/\n//</p>
<p>  if ( $counter == 1 ) {</p>
<p>    print $OUT &#8220;$_,\&#8221;weight\&#8221;\n&#8221;;<br />
    next;</p>
<p>  }</p>
<p>  my %vtr;<br />
  @vtr{ @names } = ( split /,/, $_, $maxfields )[@fields];</p>
<p>  $weight = 0;<br />
  $counter++;</p>
<p>  $weight += .5 if $vtr{ &#8216;ppp00&#8242; } eq &#8216;&#8221;R&#8221;&#8216;);</p>
<p>  for ( @fields ) {</p>
<p>    $weight += $vtr{ $_ } eq &#8216;&#8221;D&#8221;&#8216; ? -1 :<br />
               $vtr{ $_ } eq &#8216;&#8221;R&#8221;&#8216; ?  1 :<br />
               0;</p>
<p>  }</p>
<p>  print $OUT &#8220;$_,\&#8221;$weight\&#8221;\n&#8221;;<br />
  print &#8220;Processed: $counter\r&#8221;;</p>
<p>}</p>
<p>print &#8220;\n&#8221;;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

