<?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: How I write Perl</title>
	<atom:link href="http://stevengharms.com/how-i-write-perl/feed" rel="self" type="application/rss+xml" />
	<link>http://stevengharms.com/how-i-write-perl</link>
	<description>My Blog</description>
	<lastBuildDate>Thu, 29 Jul 2010 21:58:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: steven</title>
		<link>http://stevengharms.com/how-i-write-perl/comment-page-1#comment-1702</link>
		<dc:creator>steven</dc:creator>
		<pubDate>Sat, 16 Aug 2008 23:23:13 +0000</pubDate>
		<guid isPermaLink="false">http://stevengharms.com/how-i-write-perl#comment-1702</guid>
		<description>&lt;p&gt;Wow, I&#039;m really surprised this post is generating this much commentary.  You never know what&#039;s going to attract people.&lt;/p&gt;

&lt;p&gt;My key focus in this post was to underscore how much I like to run main() as a “stack” of functions.  The independent sub-strata of the code were &lt;em&gt;not&lt;/em&gt; my key focuses.&lt;/p&gt;

&lt;p&gt;I&#039;ll agree that the “consequent first” if statement is preferable ( I think I had something there in the else condition originally ).  You don&#039;t see it in this code, but I use it, a lot.&lt;/p&gt;

&lt;p&gt;But I certainly don&#039;t think using $_ is as abhorrent as you make it out to be.  If a reader understands the Perl iterators and knows that $_ is automatically set, why not take advantage?  Your opinion that this is “not best practice” is in opposition to Joseph Hall&#039;s &lt;em&gt;Effective Perl Programming&lt;/em&gt; which encourages the practice.&lt;/p&gt;

&lt;p&gt;As far as naming convention goes, they&#039;re a bit wordy and admittedly a bit uninformative, but given the very limited scope of this post their naming wasn&#039;t a huge focus ( there&#039;s only one &lt;em&gt;arr&lt;/em&gt;ay with the very primitive source data ) there&#039;s only one HoA, etc.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Wow, I&#8217;m really surprised this post is generating this much commentary.  You never know what&#8217;s going to attract people.</p>
<p>My key focus in this post was to underscore how much I like to run main() as a “stack” of functions.  The independent sub-strata of the code were <em>not</em> my key focuses.</p>
<p>I&#8217;ll agree that the “consequent first” if statement is preferable ( I think I had something there in the else condition originally ).  You don&#8217;t see it in this code, but I use it, a lot.</p>
<p>But I certainly don&#8217;t think using $_ is as abhorrent as you make it out to be.  If a reader understands the Perl iterators and knows that $_ is automatically set, why not take advantage?  Your opinion that this is “not best practice” is in opposition to Joseph Hall&#8217;s <em>Effective Perl Programming</em> which encourages the practice.</p>
<p>As far as naming convention goes, they&#8217;re a bit wordy and admittedly a bit uninformative, but given the very limited scope of this post their naming wasn&#8217;t a huge focus ( there&#8217;s only one <em>arr</em>ay with the very primitive source data ) there&#8217;s only one HoA, etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://stevengharms.com/how-i-write-perl/comment-page-1#comment-1701</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Sat, 16 Aug 2008 17:42:14 +0000</pubDate>
		<guid isPermaLink="false">http://stevengharms.com/how-i-write-perl#comment-1701</guid>
		<description>&lt;p&gt;Not surprisingly, the comment formatting was messed up on my post. When reading, insert indentation, backslashes and the occasional other missing character (underscore after dollar sign, in some places) where necessary.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Not surprisingly, the comment formatting was messed up on my post. When reading, insert indentation, backslashes and the occasional other missing character (underscore after dollar sign, in some places) where necessary.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://stevengharms.com/how-i-write-perl/comment-page-1#comment-1700</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Sat, 16 Aug 2008 17:36:44 +0000</pubDate>
		<guid isPermaLink="false">http://stevengharms.com/how-i-write-perl#comment-1700</guid>
		<description>&lt;p&gt;The formatting looks OK from far away, but the naming conventions, OMFG. I don&#039;t know what to say.&lt;/p&gt;

&lt;p&gt;Giving variables names like &#039;data_structure&#039; and &#039;temp_array&#039; is just wrong. And what is a &#039;ray&#039; in the context of your program? @clustered_contents_ray ??&lt;/p&gt;

&lt;p&gt;And using the special variables to refer to input, without ever naming them, is bad practice. I&#039;m talking about your use of things like $&lt;em&gt;[0]-&gt;{contents}, where $&lt;/em&gt;[0] is never given a name.&lt;/p&gt;

&lt;p&gt;Also it&#039;s considered bad practice to use $_ as much as you are. Name your variables.&lt;/p&gt;

&lt;p&gt;Also perl5 has some new idioms you should take advantage of. Instead of:&lt;/p&gt;

&lt;p&gt;if ( scalar ( @temp_array ) != 3 )
                {
                        print &quot;There was something amiss with entry:n$_&quot;;
                        exit 1;
                }
}
else&lt;/p&gt;

&lt;p&gt;You can say:&lt;/p&gt;

&lt;p&gt;die &quot;There was something amiss with entry:n$_nn&quot;
    unless (@temp_array == 3);&lt;/p&gt;

&lt;p&gt;Still very clear. No &#039;else&#039; needed either, if your program is exiting. And give $_ a name.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The formatting looks OK from far away, but the naming conventions, OMFG. I don&#8217;t know what to say.</p>
<p>Giving variables names like &#8216;data_structure&#8217; and &#8216;temp_array&#8217; is just wrong. And what is a &#8216;ray&#8217; in the context of your program? @clustered_contents_ray ??</p>
<p>And using the special variables to refer to input, without ever naming them, is bad practice. I&#8217;m talking about your use of things like $<em>[0]-&gt;{contents}, where $</em>[0] is never given a name.</p>
<p>Also it&#8217;s considered bad practice to use $_ as much as you are. Name your variables.</p>
<p>Also perl5 has some new idioms you should take advantage of. Instead of:</p>
<p>if ( scalar ( @temp_array ) != 3 )<br />
                {<br />
                        print &#8220;There was something amiss with entry:n$_&#8221;;<br />
                        exit 1;<br />
                }<br />
}<br />
else</p>
<p>You can say:</p>
<p>die &#8220;There was something amiss with entry:n$_nn&#8221;<br />
    unless (@temp_array == 3);</p>
<p>Still very clear. No &#8216;else&#8217; needed either, if your program is exiting. And give $_ a name.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: steven</title>
		<link>http://stevengharms.com/how-i-write-perl/comment-page-1#comment-1699</link>
		<dc:creator>steven</dc:creator>
		<pubDate>Sat, 16 Aug 2008 15:22:59 +0000</pubDate>
		<guid isPermaLink="false">http://stevengharms.com/how-i-write-perl#comment-1699</guid>
		<description>&lt;p&gt;Zeek:  You&#039;re absolutely correct.  You may derive from this that I have been migrating / editing a lot of Perl 5.00 code where the previous authors’ history hadn&#039;t quite worn out.  A simple perl -pe command has fixed my code to your recommendation.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Zeek:  You&#8217;re absolutely correct.  You may derive from this that I have been migrating / editing a lot of Perl 5.00 code where the previous authors’ history hadn&#8217;t quite worn out.  A simple perl -pe command has fixed my code to your recommendation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zeek</title>
		<link>http://stevengharms.com/how-i-write-perl/comment-page-1#comment-1697</link>
		<dc:creator>zeek</dc:creator>
		<pubDate>Sat, 16 Aug 2008 06:33:53 +0000</pubDate>
		<guid isPermaLink="false">http://stevengharms.com/how-i-write-perl#comment-1697</guid>
		<description>&lt;p&gt;Calling functions like this:&lt;/p&gt;

&lt;p&gt;&amp;function();&lt;/p&gt;

&lt;p&gt;is a Perl4 leftover and deprecated in Perl5.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Calling functions like this:</p>
<p>&amp;function();</p>
<p>is a Perl4 leftover and deprecated in Perl5.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stevengharms.com &#187; Blog Archive &#187; Benefits of “Functional Perl”: ease of modification</title>
		<link>http://stevengharms.com/how-i-write-perl/comment-page-1#comment-1690</link>
		<dc:creator>stevengharms.com &#187; Blog Archive &#187; Benefits of “Functional Perl”: ease of modification</dc:creator>
		<pubDate>Fri, 15 Aug 2008 23:26:28 +0000</pubDate>
		<guid isPermaLink="false">http://stevengharms.com/how-i-write-perl#comment-1690</guid>
		<description>&lt;p&gt;[...] an earlier post I provided code demonstrating my “functional” Perl idiom. The purpose of that code was to take a very simply formatted text file and to turn it into LaTeX [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[&#8230;] an earlier post I provided code demonstrating my “functional” Perl idiom. The purpose of that code was to take a very simply formatted text file and to turn it into LaTeX [&#8230;]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
