<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Perl vs Python: Why the debate is meaningless</title>
	<atom:link href="http://bytebaker.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/feed/" rel="self" type="application/rss+xml" />
	<link>http://bytebaker.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/</link>
	<description>Computer Science isn&#039;t a science and it&#039;s not about computers</description>
	<lastBuildDate>Tue, 15 May 2012 16:22:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: qo</title>
		<link>http://bytebaker.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/#comment-1632</link>
		<dc:creator><![CDATA[qo]]></dc:creator>
		<pubDate>Tue, 24 Apr 2012 18:20:09 +0000</pubDate>
		<guid isPermaLink="false">http://xcomputers.wordpress.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/#comment-1632</guid>
		<description><![CDATA[Hey, thanks much jameslaymusic!  Your tip regarding contatenation within the re was exactly what I needed.

&lt;pre&gt;
import re
vlan = 100
line = &quot;100 I want to capture THIS thing only if line starts with vlan&quot;
m = re.search(&#039;^&#039; + str(vlan) + &#039;.*?(THIS) thing only if line starts with vlan&#039;,line)
print m.group(1)
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Hey, thanks much jameslaymusic!  Your tip regarding contatenation within the re was exactly what I needed.</p>
<pre>
import re
vlan = 100
line = "100 I want to capture THIS thing only if line starts with vlan"
m = re.search('^' + str(vlan) + '.*?(THIS) thing only if line starts with vlan',line)
print m.group(1)
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: jameslaymusic</title>
		<link>http://bytebaker.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/#comment-1630</link>
		<dc:creator><![CDATA[jameslaymusic]]></dc:creator>
		<pubDate>Tue, 24 Apr 2012 08:22:07 +0000</pubDate>
		<guid isPermaLink="false">http://xcomputers.wordpress.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/#comment-1630</guid>
		<description><![CDATA[also, don&#039;t forget you can always typecast!
vlan = 100
vlan = str(vlan)]]></description>
		<content:encoded><![CDATA[<p>also, don&#8217;t forget you can always typecast!<br />
vlan = 100<br />
vlan = str(vlan)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jameslaymusic</title>
		<link>http://bytebaker.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/#comment-1629</link>
		<dc:creator><![CDATA[jameslaymusic]]></dc:creator>
		<pubDate>Tue, 24 Apr 2012 08:16:47 +0000</pubDate>
		<guid isPermaLink="false">http://xcomputers.wordpress.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/#comment-1629</guid>
		<description><![CDATA[In response to qo ^^

Python is strongly typed, so make sure it knows that vlan is a string.  Also, the regex is itself a string.  Just concatenate vlan into your regex when you pass it.

import re
vlan = &quot;100&quot;
line = &quot;100 find if starts with vlan&quot;
m = re.findall(&quot;^&quot; + vlan + &quot;.*&quot;, line)
print(m)]]></description>
		<content:encoded><![CDATA[<p>In response to qo ^^</p>
<p>Python is strongly typed, so make sure it knows that vlan is a string.  Also, the regex is itself a string.  Just concatenate vlan into your regex when you pass it.</p>
<p>import re<br />
vlan = &#8220;100&#8243;<br />
line = &#8220;100 find if starts with vlan&#8221;<br />
m = re.findall(&#8220;^&#8221; + vlan + &#8220;.*&#8221;, line)<br />
print(m)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: qo</title>
		<link>http://bytebaker.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/#comment-1610</link>
		<dc:creator><![CDATA[qo]]></dc:creator>
		<pubDate>Tue, 10 Apr 2012 23:18:03 +0000</pubDate>
		<guid isPermaLink="false">http://xcomputers.wordpress.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/#comment-1610</guid>
		<description><![CDATA[Looks like it does :-)  Anyway below are the two examples, with proper indents...


&lt;pre&gt;
$vlan = 100;
$line = &quot;100 I want to capture THIS thing only if line starts with vlan&quot;;
if($line =~ /^$vlan.*?(THIS) thing only if line starts with vlan/) {
    print &quot;$1\n&quot;;
}
&lt;/pre&gt;

&lt;pre&gt;
import re
vlan = 100
line = &quot;100 I want to capture THIS thing only if line starts with vlan&quot;
m = re.search(&#039;^(\d+).*?(THIS) thing only if line starts with vlan&#039;,line)
if(int(m.group(1)) == vlan):
    print m.group(2)
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Looks like it does <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   Anyway below are the two examples, with proper indents&#8230;</p>
<pre>
$vlan = 100;
$line = "100 I want to capture THIS thing only if line starts with vlan";
if($line =~ /^$vlan.*?(THIS) thing only if line starts with vlan/) {
    print "$1\n";
}
</pre>
<pre>
import re
vlan = 100
line = "100 I want to capture THIS thing only if line starts with vlan"
m = re.search('^(\d+).*?(THIS) thing only if line starts with vlan',line)
if(int(m.group(1)) == vlan):
    print m.group(2)
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: qo</title>
		<link>http://bytebaker.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/#comment-1609</link>
		<dc:creator><![CDATA[qo]]></dc:creator>
		<pubDate>Tue, 10 Apr 2012 23:15:53 +0000</pubDate>
		<guid isPermaLink="false">http://xcomputers.wordpress.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/#comment-1609</guid>
		<description><![CDATA[Sorry for the lack of indenting.  Does this support raw html?

&lt;pre&gt;
Testing {
   testing {
      testing {
         foo;
      }
   }
}
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Sorry for the lack of indenting.  Does this support raw html?</p>
<pre>
Testing {
   testing {
      testing {
         foo;
      }
   }
}
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: qo</title>
		<link>http://bytebaker.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/#comment-1608</link>
		<dc:creator><![CDATA[qo]]></dc:creator>
		<pubDate>Tue, 10 Apr 2012 23:12:49 +0000</pubDate>
		<guid isPermaLink="false">http://xcomputers.wordpress.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/#comment-1608</guid>
		<description><![CDATA[I&#039;ve been scripting with perl for a while and have recently started looking into python.  But something is hanging me up with python&#039;s re module and since regex accounts for most of what I need this is sorta a show stopper for me.  Maybe someone can clarify for me (trust me, I&#039;ve searched the web high and low to no avail).

How do you write a regex in python that includes variables?

That is, in perl (condensed to as simple an example as possible, e.g. $vlan will be dynamically changing based on an input data set, and we&#039;re plowing through many lines, not just one, etc):

$vlan = 100;
$line = &quot;100 I want to capture THIS thing only if line starts with vlan&quot;;
if($line =~ /^$vlan.*?(THIS) thing only if line starts with vlan/) {
    print &quot;$1\n&quot;;
}

In python the closest I&#039;ve gotten since I can&#039;t figure out how to use a variable in a regex is:

import re
vlan = 100
line = &quot;100 I want to capture THIS thing only if line starts with vlan&quot;
m = re.search(&#039;^(\d+).*?(THIS) thing only if line starts with vlan&#039;,line)
if(int(m.group(1)) == vlan):
    print m.group(2)

Actually, perl would be even less messy using $_:

$vlan = 100;
foreach (@lines) {
   if(/^$vlan.*?(THIS) thing only if line starts with vlan/) {
      print &quot;$1\n&quot;;
   }
}

Anyway, I&#039;m not trying to put python down.  I really really like it so far.  But I&#039;ve lived with perl&#039;s regex for so long that I&#039;d miss not being able to alter a regex dynamically.  Maybe there&#039;s a python module I&#039;m not aware of that extends re?

Thanks!]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve been scripting with perl for a while and have recently started looking into python.  But something is hanging me up with python&#8217;s re module and since regex accounts for most of what I need this is sorta a show stopper for me.  Maybe someone can clarify for me (trust me, I&#8217;ve searched the web high and low to no avail).</p>
<p>How do you write a regex in python that includes variables?</p>
<p>That is, in perl (condensed to as simple an example as possible, e.g. $vlan will be dynamically changing based on an input data set, and we&#8217;re plowing through many lines, not just one, etc):</p>
<p>$vlan = 100;<br />
$line = &#8220;100 I want to capture THIS thing only if line starts with vlan&#8221;;<br />
if($line =~ /^$vlan.*?(THIS) thing only if line starts with vlan/) {<br />
    print &#8220;$1\n&#8221;;<br />
}</p>
<p>In python the closest I&#8217;ve gotten since I can&#8217;t figure out how to use a variable in a regex is:</p>
<p>import re<br />
vlan = 100<br />
line = &#8220;100 I want to capture THIS thing only if line starts with vlan&#8221;<br />
m = re.search(&#8216;^(\d+).*?(THIS) thing only if line starts with vlan&#8217;,line)<br />
if(int(m.group(1)) == vlan):<br />
    print m.group(2)</p>
<p>Actually, perl would be even less messy using $_:</p>
<p>$vlan = 100;<br />
foreach (@lines) {<br />
   if(/^$vlan.*?(THIS) thing only if line starts with vlan/) {<br />
      print &#8220;$1\n&#8221;;<br />
   }<br />
}</p>
<p>Anyway, I&#8217;m not trying to put python down.  I really really like it so far.  But I&#8217;ve lived with perl&#8217;s regex for so long that I&#8217;d miss not being able to alter a regex dynamically.  Maybe there&#8217;s a python module I&#8217;m not aware of that extends re?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bob</title>
		<link>http://bytebaker.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/#comment-1390</link>
		<dc:creator><![CDATA[bob]]></dc:creator>
		<pubDate>Mon, 21 Nov 2011 19:50:36 +0000</pubDate>
		<guid isPermaLink="false">http://xcomputers.wordpress.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/#comment-1390</guid>
		<description><![CDATA[I agree with this article 100%.  It&#039;s like a carpenter asking &quot;what tool is better, a saw or a hammer?&quot;.  I&#039;m shocked to see the many responses from people promoting their language as being somehow better.  There is a difference between what is more practical for a given task and what is more enjoyable.  Most people&#039;s arguments essentially boil down to an argument about why one language or the other is more enjoyable.]]></description>
		<content:encoded><![CDATA[<p>I agree with this article 100%.  It&#8217;s like a carpenter asking &#8220;what tool is better, a saw or a hammer?&#8221;.  I&#8217;m shocked to see the many responses from people promoting their language as being somehow better.  There is a difference between what is more practical for a given task and what is more enjoyable.  Most people&#8217;s arguments essentially boil down to an argument about why one language or the other is more enjoyable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aMoLk</title>
		<link>http://bytebaker.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/#comment-889</link>
		<dc:creator><![CDATA[aMoLk]]></dc:creator>
		<pubDate>Sat, 20 Nov 2010 21:46:54 +0000</pubDate>
		<guid isPermaLink="false">http://xcomputers.wordpress.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/#comment-889</guid>
		<description><![CDATA[I am a System Admin with over 6 years of experience working with big companies.
And I have yet to see 1 (really, even 1), Server which has python installed on it. These are hardened servers, so they only installs minimal things that are needed.

Perl is ubiquitous. Its on every Unix/Linux Server. A server might not have xterm or top or wget, but it has perl.

That oughtta tell you something!]]></description>
		<content:encoded><![CDATA[<p>I am a System Admin with over 6 years of experience working with big companies.<br />
And I have yet to see 1 (really, even 1), Server which has python installed on it. These are hardened servers, so they only installs minimal things that are needed.</p>
<p>Perl is ubiquitous. Its on every Unix/Linux Server. A server might not have xterm or top or wget, but it has perl.</p>
<p>That oughtta tell you something!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Demolishun</title>
		<link>http://bytebaker.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/#comment-775</link>
		<dc:creator><![CDATA[Demolishun]]></dc:creator>
		<pubDate>Mon, 12 Jul 2010 22:16:37 +0000</pubDate>
		<guid isPermaLink="false">http://xcomputers.wordpress.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/#comment-775</guid>
		<description><![CDATA[Here are the languages I have used:
Assembler (several architectures both MIPS and RISC)
Basic (DOS and Visual)
C
C++
PHP
Perl
Python
Pascal

My impression coming onto a project using over 23K lines of Perl and years of different developers:
I will grow old and die trying to understand that code!
There is consistency in style mostly on this project and that is a blessing.  However, understanding the nuances of all the sorting, pattern matching, etc is serious brain damage.   It is working code and I touch it as little as possible.  

My impression of python:
Easy to understand and use.  Once I got my head around that this is not C++ it was easier to break the rules and do it the Python way.  For new projects I will pursue Python or PHP (webbased).  

Neither of these were my first language.  My learning went like this: Pascal, Assembler, C++, C, Basic, a bunch of other crap, Python, Perl, more crap.  My preference is to use Python for projects as I can lay out the code quickly.  The next I grab is C++.  For web however, I grab PHP and try to stay away from Perl except for existing code.  

However, one thing impressed me about Perl.  When I needed to use Perl with a PHP session I was able to find working Perl code that bridged that gap.  This allowed all authentication to be through a CMS system based upon PHP, but allowed me to maintain the high quality working Perl code to continue on as though nothing had changed.  That is a testament to Perl programmers. 

Right now I am working on a project where I need to receive an event from an internet client, queue the event, process the request on a server different from the web based server, send a resulting file to a third party website, send a message back to the client at a later time (latent notification) about where the information was posted.  The initiating event will be done in PHP, the storage will be in MySQL, the second server will poll the database of the first using possibly a combination of PHP and Python or just Python.  The second server will launch an application using Wine to produce the file and post this file.  

Python was my choice because it is so versatile and I don&#039;t need to spend a lot of time getting versed in it.  Even though I has used Python before learning Perl I had forgotten most things about Python.  It took only a couple of hours to get back up and productive.  I only have so much time on this Earth to do things.  If I am going to do something I am going to use the tool with the most bang for the buck for the application at hand.  A language may have superior processing of whatever data structures, but what use is it if the brain damage required to understand those features takes up more time than to create the solution in a different language in the first place?  Yeah, that was a run-on sentence. : )  

So, yes, the debate is meaningless.  Different tools, different strengths, and vastly different user bases.  I would not for a second think that a computer genius using his tool of choice could not crush a novice with a sexy new computer language any day.  I am not that genius and Perl and me don&#039;t get along.]]></description>
		<content:encoded><![CDATA[<p>Here are the languages I have used:<br />
Assembler (several architectures both MIPS and RISC)<br />
Basic (DOS and Visual)<br />
C<br />
C++<br />
PHP<br />
Perl<br />
Python<br />
Pascal</p>
<p>My impression coming onto a project using over 23K lines of Perl and years of different developers:<br />
I will grow old and die trying to understand that code!<br />
There is consistency in style mostly on this project and that is a blessing.  However, understanding the nuances of all the sorting, pattern matching, etc is serious brain damage.   It is working code and I touch it as little as possible.  </p>
<p>My impression of python:<br />
Easy to understand and use.  Once I got my head around that this is not C++ it was easier to break the rules and do it the Python way.  For new projects I will pursue Python or PHP (webbased).  </p>
<p>Neither of these were my first language.  My learning went like this: Pascal, Assembler, C++, C, Basic, a bunch of other crap, Python, Perl, more crap.  My preference is to use Python for projects as I can lay out the code quickly.  The next I grab is C++.  For web however, I grab PHP and try to stay away from Perl except for existing code.  </p>
<p>However, one thing impressed me about Perl.  When I needed to use Perl with a PHP session I was able to find working Perl code that bridged that gap.  This allowed all authentication to be through a CMS system based upon PHP, but allowed me to maintain the high quality working Perl code to continue on as though nothing had changed.  That is a testament to Perl programmers. </p>
<p>Right now I am working on a project where I need to receive an event from an internet client, queue the event, process the request on a server different from the web based server, send a resulting file to a third party website, send a message back to the client at a later time (latent notification) about where the information was posted.  The initiating event will be done in PHP, the storage will be in MySQL, the second server will poll the database of the first using possibly a combination of PHP and Python or just Python.  The second server will launch an application using Wine to produce the file and post this file.  </p>
<p>Python was my choice because it is so versatile and I don&#8217;t need to spend a lot of time getting versed in it.  Even though I has used Python before learning Perl I had forgotten most things about Python.  It took only a couple of hours to get back up and productive.  I only have so much time on this Earth to do things.  If I am going to do something I am going to use the tool with the most bang for the buck for the application at hand.  A language may have superior processing of whatever data structures, but what use is it if the brain damage required to understand those features takes up more time than to create the solution in a different language in the first place?  Yeah, that was a run-on sentence. : )  </p>
<p>So, yes, the debate is meaningless.  Different tools, different strengths, and vastly different user bases.  I would not for a second think that a computer genius using his tool of choice could not crush a novice with a sexy new computer language any day.  I am not that genius and Perl and me don&#8217;t get along.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: crispy</title>
		<link>http://bytebaker.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/#comment-774</link>
		<dc:creator><![CDATA[crispy]]></dc:creator>
		<pubDate>Fri, 02 Jul 2010 17:17:10 +0000</pubDate>
		<guid isPermaLink="false">http://xcomputers.wordpress.com/2007/01/29/perl-vs-python-why-the-debate-is-meaningless/#comment-774</guid>
		<description><![CDATA[I can see that when somebody tries to promote one programming language over another, they obviously do not know the language they (use&#124;don&#039;t use) as well as they should.

I am an avid Python user, but I highly respect Perl magicians. To this day, I am still trying to better learn Perl and can not use it as well as I can Python. I do appreciate how Perl is a better language choice in some cases than Python. 

Just because you can not understand somebody else&#039;s Perl script, it doesn&#039;t mean the language is bad - it&#039;s because you don&#039;t know Perl well enough to interpret their code.]]></description>
		<content:encoded><![CDATA[<p>I can see that when somebody tries to promote one programming language over another, they obviously do not know the language they (use|don&#8217;t use) as well as they should.</p>
<p>I am an avid Python user, but I highly respect Perl magicians. To this day, I am still trying to better learn Perl and can not use it as well as I can Python. I do appreciate how Perl is a better language choice in some cases than Python. </p>
<p>Just because you can not understand somebody else&#8217;s Perl script, it doesn&#8217;t mean the language is bad &#8211; it&#8217;s because you don&#8217;t know Perl well enough to interpret their code.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

