<?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>Perlblogs &#187; perl</title>
	<atom:link href="http://perlblogs.com/category/perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://perlblogs.com</link>
	<description>Posts from selected Perl bloggers</description>
	<lastBuildDate>Mon, 06 Feb 2012 20:47:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>Null Objects, Error Handling, and Robustness</title>
		<link>http://www.modernperlbooks.com/mt/2012/02/null-objects-error-handling-and-robustness.html</link>
		<comments>http://www.modernperlbooks.com/mt/2012/02/null-objects-error-handling-and-robustness.html#comments</comments>
		<pubDate>Mon, 06 Feb 2012 18:28:15 +0000</pubDate>
		<dc:creator>chromatic</dc:creator>
				<category><![CDATA[modernperl]]></category>
		<category><![CDATA[oo]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[softwaredesign]]></category>

		<guid isPermaLink="false">http://perlblogs.com/?guid=ffcf277a3ae1133a4eef67dc1c96c540</guid>
		<description><![CDATA[A Practical Use for Macros in Perl generated several thoughtful comments. While Aristotle Pagaltzis identified the real semantic difficulty with the code I wanted to write (and mentioned the Null Object pattern, which I always keep in mind), Chas. Owens...]]></description>
			<content:encoded><![CDATA[
        <p><a href="http://www.modernperlbooks.com/mt/2012/02/a-practical-use-for-macros-in-perl.html">A Practical Use for Macros in Perl</a> generated several thoughtful comments. While <a href="http://plasmasturm.org/">Aristotle Pagaltzis</a> identified the real semantic difficulty with the code I wanted to write (and mentioned the <a href="http://www.c2.com/cgi/wiki?NullObject">Null Object pattern</a>, which I always keep in mind), <a href="http://wonkden.net/">Chas. Owens</a> asked perhaps the best <em>philosophical</em> question:</p>

<blockquote><em>Why not modify add_txn to reject undefs?</em></blockquote>

<p>The code in review is:</p>

<pre><code>while (my $stock = $stock_rs-&gt;next)
{
    my $pe_update = $self-&gt;analyze_pe( $stock );
    $stock_txn-&gt;add( $pe_update ) if $pe_update;

    my $cash_yield_update = $self-&gt;analyze_cash_yield( $stock );
    $analysis_txn-&gt;add( $cash_yield_update ) if $cash_yield_update;
}</code></pre>

<p>... and the near duplication obscures (to me) the point of the code. Both Aristotle and Chas. are right&mdash;perhaps it's clearer to allow <code>$transaction-&gt;add</code> to do nothing when it receives nothing. I write "perhaps" because I see the appeal of that change, but I'm not sure I like it.</p>

<p>As usual with my software, the system has a fundamental design principle:
either succeed in full or do nothing. It's fine to skip half of the analysis
steps if the data just isn't there. (The project as a whole can succeed if it's
only 60% correct; the joy of a margin of error. It's a lot more accurate than
that.)</p>

<p>I take this principle to mean that robustness is more important than
completeness. Skipping bad data and moving on is perfectly fine. The next run
may improve transient errors, and catastrophic errors will require human
intervention anyhow.</p>

<p>When these principles translate into design, I prefer to handle errors at
the point of detection and not spread error handling throughout the system.
All of these analysis methods <em>should</em> return something. When they
succeed, they return a hash reference mapping column names to values in a
database table. When these methods fail&mdash;whether the existing data isn't
sufficient to calculate updated values or something else went wrong&mdash;they
<code>return;</code>. As you well know, that's an empty list in list context
and <code>undef</code> in the scalar context of the example code.</p>

<p>Why add nothing to a transaction when I know there's nothing to add? Yes,
<code>add()</code> could check that it has nothing to do and do nothing, and
that's fine, but it seems like that expands the behavior of
<code>add()</code>'s API to include caller errors. Then again, the
<code>add()</code> method must check that each hash reference contains a value
for the transaction's bound primary key, or it will generate buggy output.</p>

<p>I suspect that both Aristotle and Chas. have in mind <a href="http://c2.com/cgi/wiki?JonPostel">Postel's Law</a>:</p>

<blockquote><em>Be generous in what you accept and picky about what you emit.</em></blockquote>

<p>The result might look something like:</p>

<pre><code>while (my $stock = $stock_rs-&gt;next)
{
    $stock_txn-&gt;add(    $self-&gt;analyze_pe( $stock )         );
    $analysis_txn-&gt;add( $self-&gt;analyze_cash_yield( $stock ) );
}</code></pre>

<p>This change has an advantage: it only necessitates a change in the
<code>add()</code> method. All of the <code>analyze_*()</code> methods can
continue to work as implemented.</p>

<p>Of course, there's a slight performance penalty to doing this. In my case,
it's immaterial, but it wouldn't be present with macros. This is an IO-bound
application anyhow, and the transaction manager exists to avoid very real, very
measured bottlenecks.</p>

<p>Finally, Aristotle's mention of the null object pattern was about
<em>real</em> objects, and not methods which return empty lists or hash
references. If that's your style, good for you&mdash;but it's not mine in this
case. While it's not obvious from the small snippets I've posted so far, the
responsibility of the analysis methods is smaller in scope than the
responsibility of the transaction objects. Coupling transaction management to
the analysis methods&mdash;in as much that they have to know about transactions
to return the right objects&mdash;would turn the design of the system inside
out. The result would very likely not be an improvement.</p>
        
    ]]></content:encoded>
			<wfw:commentRss>http://perlblogs.com/2012/02/06/null-objects-error-handling-and-robustness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why I Run Tests on Install</title>
		<link>http://www.modernperlbooks.com/mt/2012/01/why-i-run-tests-on-install.html</link>
		<comments>http://www.modernperlbooks.com/mt/2012/01/why-i-run-tests-on-install.html#comments</comments>
		<pubDate>Tue, 31 Jan 2012 18:41:08 +0000</pubDate>
		<dc:creator>chromatic</dc:creator>
				<category><![CDATA[cpan]]></category>
		<category><![CDATA[modernperl]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://perlblogs.com/?guid=c3e05fd8a848a80ef83b5d3deb04579f</guid>
		<description><![CDATA[Jonathan Swartz makes a polemic statement: cpanm and perlbrew should not run tests by default. His points are reasonable, but his complaints are mostly about side effects and not the real problem. (I should clarify: the real problem I encounter.)...]]></description>
			<content:encoded><![CDATA[
        <p>Jonathan Swartz makes a polemic statement:</p>

<blockquote><em><a href="http://www.openswartz.com/2012/01/31/stop-running-tests-on-install/">cpanm and perlbrew should not run tests by default.</a></em></blockquote>

<p>His points are reasonable, but his complaints are mostly about side effects
and not the real problem. (I should clarify: the real problem <em>I</em>
encounter.)</p>

<p>If running tests slow down installs, speed up the tests. (Do you want to get the wrong answer faster? Easy: it's 42. No need for a quantum computer to do the calculation in constant time. This algorithm is O(0).)</p>

<p>If running tests exposes the fragility of the dependency chain, improve the dependency chain.</p>

<p>If dependency test failures prevent the installation of downstream
clients... this <em>is</em> a weakness of the CPAN toolchain. A well-written
test suite for a downstream client should reveal whether bugs or other sources
of test failures in a dependency affect the correctness of the client.</p>

<p>Note the assumptions in that sentence.</p>

<p>Anyone who's experienced the flash of enlightenment that comes from working
with well tested code and who's shared that new zeal with co-workers has
undoubtedly heard the hoary old truism that testing cannot prove the complete
absence of bugs. It's no less true for its age, though it's also true that
<em>good</em> testing only improves our confidence in the correctness and
efficacy of our code.</p>

<p>For me, a 95% certainty that my code works and continues to work for the
things to which I've tested it is more than sufficient. I focus on testing the
things I'm most likely to get wrong and the things which need to keep working
correctly. (I don't care much about pixel-perfect placement, but I do care that
a book's index uses the right escapes for its data and markup.)</p>

<p>Without tests running on the machines themselves in the environments
themselves where I expect my code to run, I don't have that confidence.</p>

<p>Put another way, I'm either not smart enough or far too lazy to want to
attempt to debug code without good tests. That's why I write tests, and that's
why I run them obsessively. That's good for me as a developer, and you're
getting the unvarnished developer perspective.</p>

<p><a href="http://www.modernperlbooks.com/mt/2011/10/in-search-of-minimum-viable-utility.html">I also care about the perspective of mere users</a>. (Without users, we're amusing ourselves, and I can think of better ways to amuse myself than by writing software no one uses.).</p>

<p>Yes, an excellent test suite can help a user help a developer debug a
problem. Many (most?) CPAN authors have had the wonderful experience of
receiving a bug report with a failing test case. Sometimes this even includes a
code patch.</p>

<p>Not all users are developers of that sort, nor should they be.</p>

<p>The CPAN ecosystem has improved greatly at automated testing and dependency tracking, but we can improve further. What if we could identify the severity of test failures? (We have TODO and SKIP, but they don't convey semantic meaning.) What if we could identify buggy or fragile tests? (My current favorite is <a href="https://rt.cpan.org/Ticket/Display.html?id=69540">XML::Feed tests versus DateTime::Format::Atom</a> because it catches me far too often, it doesn't affect the operation of the code, and it's a stupid fix that's lingered for a few months.) What if the failures are transient (Mechanize relying on your ISP <em>not</em> ruining DNS lookups for you) or specific to your environment (a test suite written without parallelism in mind).</p>

<p>As Jonathan rightly implies, how do you expect an end-user to understand or
care about or debug those things?</p>

<p>I'm still reluctant to agree that disabling tests for end-user installations
is the right solution. I <em>want</em> to know about failures in the wild wider
world. I want that confidence, but I can't bring myself to trade away that
confidence for the sake of a little more speed of installation.</p>

<p>Yet his point about lingering points of fragility in the ecosystem are true
and important, even if the proposed solution of skipping tests isn't right.
Fortunately, improving dependency management and tracking and use and testing
can help solve both issues: perhaps to the point where we can run only those
tests users most care about and identify and report material failures in
dependencies.</p>

        
    ]]></content:encoded>
			<wfw:commentRss>http://perlblogs.com/2012/01/31/why-i-run-tests-on-install/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Avoiding The Vendor Perl Fad Diet</title>
		<link>http://www.modernperlbooks.com/mt/2012/01/avoiding-the-vendor-perl-fad-diet.html</link>
		<comments>http://www.modernperlbooks.com/mt/2012/01/avoiding-the-vendor-perl-fad-diet.html#comments</comments>
		<pubDate>Wed, 25 Jan 2012 19:46:20 +0000</pubDate>
		<dc:creator>chromatic</dc:creator>
				<category><![CDATA[distributions]]></category>
		<category><![CDATA[p5p]]></category>
		<category><![CDATA[packaging]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[perl5]]></category>

		<guid isPermaLink="false">http://perlblogs.com/?guid=c76c09804e86429f483ba7aab2bb1fe7</guid>
		<description><![CDATA[Here we go again. It looks like Red Hat is distributing Perl without the core library ExtUtils::MakeMaker. If you're not familiar with the details of the Perl 5 build chain, all you need to know is this: without MakeMaker, you're...]]></description>
			<content:encoded><![CDATA[
        <p>Here we go again.</p>

<p>It looks like <a
href="http://www.nntp.perl.org/group/perl.perl5.porters/2012/01/msg182360.html">Red
Hat is distributing Perl without the core library
<code>ExtUtils::MakeMaker</code></a>. If you're not familiar with the details
of the Perl 5 build chain, all you need to know is this: without MakeMaker,
you're not installing anything from the CPAN.</p>

<p>Ostensibly Red Hat and other OS distribution vendors split up Perl 5 into
separate packages to save room on installation media. Core Perl 5 is large and
includes many, many things that not everyone uses all the time... but <a
href="http://www.nntp.perl.org/group/perl.perl5.porters/2012/01/msg182376.html">the
obvious reaction to defining a core subset of Perl 5 that a vendor can call
"perl"</a> is another of those recurring discussions which never quite goes
anywhere.</p>

<p>For example, who needs the documentation just to run code? (Except that the
<code>diagnostics</code> pragma relies on the existence of
<em>perldiag.pod</em> to run.) Who needs the huge Unicode encoding tables for
ideographic languages such as you might find in Japan, China, Korea, and other
Asian locals? (Answer: Asia.) Who needs the ability to install code from the
CPAN? (Answer: users.)</p>

<p>While there's a lot of stuff in the core that probably doesn't need to be in
the core, or at least installed by default (a LaTex formatter for POD, the <a
href="http://search.cpan.org/perldoc?Switch">deprecated Switch module</a>, Perl
5.005 <a href="http://search.cpan.org/perldoc?Thread">Thread</a> emulation),
one thing is both clear and almost never said.</p>

<p>I'll give you a moment to think about it.</p>

<p>Here's a hint: you're usually better off compiling and installing your own
Perl 5 under your complete control such that you can compile in options you
want (64-bit integers, for example) and out options you don't (threading
imposes a 15% performance penalty even in the single-threaded case) and so that
you can manage your own library paths without changing the behavior of the
system). <a href="http://perlbrew.org/">perlbrew</a> changes the game. Learn
it, like it, love it.</p>

<p>The perpetual discussion misses one important point:</p>

<p>The vendor <code>perl</code>&mdash;especially on installation media&mdash;is
not for general purpose Perl programming. It's there only to support basic
administrative programs provided with the system as a whole. <em>That's</em>
why you don't replace the system Perl. <em>That's</em> why you don't mess with
the system CPAN modules. That's why you fence off whatever's in
<em>/usr/bin/perl</em> like it's Yucca Mountain and you're stuck with a '50s
reactor design instead of something safe and clean.</p>

<p>Vendors can tune and tweak that Perl to their satisfaction to provide just
what they need to install and configure a working system. They can keep it as
crufty and out of date as they like. When it breaks, they get to keep all of
the pieces and sew them back together like some sort of Fedorastein's monster.
They just can't let it out of the lab.</p>

<p>This of course means that they need to provide packages of Perl 5 Actual for
users and developers such that it's the full core of Perl 5. (It'd be nice if
they called not-a-perl as such, but one thing at a time.)</p>

<p>You can't predict what users will and won't do. That's why you code
defensively. The moment distributions started carving up Perl to install just
the little bits they needed in the hopes that their guesses as to what users
wanted were right, they put everyone in a bind.</p>

<p>Certainly Perl 5 could benefit from a thorough review of what's in core and
why, but I suspect that even if p5p came up with packaging guidelines for all
of the imaginable use cases and combinations of distributor needs and user
wants, it still wouldn't solve the real problem.</p>

<p>(Credit Allison Randal for pointing out the real problem <em>years</em> ago. We've discussed several times the idea of a stripped-down VM for a real language&mdash;something with better abstraction and reuse than Bash&mdash;with easy access to libraries and a very small footprint, but it's a bigger job than either of us could accomplish. It's still a righter approach than bowdlerizing an upstream distribution.)</p>
        
    ]]></content:encoded>
			<wfw:commentRss>http://perlblogs.com/2012/01/25/avoiding-the-vendor-perl-fad-diet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Decades-Old Technique to Improve Programming Languages</title>
		<link>http://www.modernperlbooks.com/mt/2012/01/a-decades-old-technique-to-improve-programming-languages.html</link>
		<comments>http://www.modernperlbooks.com/mt/2012/01/a-decades-old-technique-to-improve-programming-languages.html#comments</comments>
		<pubDate>Mon, 23 Jan 2012 20:22:23 +0000</pubDate>
		<dc:creator>chromatic</dc:creator>
				<category><![CDATA[languagedesign]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[modernperl]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://perlblogs.com/?guid=444eb064a286b9c0c7a44d340e73f101</guid>
		<description><![CDATA[I promised in Testing Your Templates to explain how to solve the problem of the divergence between testable, debuggable code in your host language and a big wad of logic in a template language. This problem is an example of...]]></description>
			<content:encoded><![CDATA[
        <p>I promised in <a
href="http://www.modernperlbooks.com/mt/2012/01/testing-your-templates-and-why-it-doesnt-always-work.html">Testing
Your Templates</a> to explain how to solve the problem of the divergence
between testable, debuggable code in your host language and a big wad of logic
in a template language.</p>

<p>This problem is an example of the pattern of Why Writing Your Own DSL is
More Difficult Than You Think. Certainly Template Toolkit is among the better
templating systems (I've written a couple myself), but it exhibits problems
endemic to the process. (Then again, so does PHP. Now multiply that by the fact
that some people use templating systems <em>written in PHP</em> and if you have
to lie down for a while before the feeling passes, please accept my
apologies.)</p>

<p>The semantics of Template Toolkit are great, when they work, but then
everything's great when it works the way you expect. Robust software handles
the cases you don't expect with aplomb, or at least without a boom.</p>

<p>A simple workaround for Template Toolkit is to avoid the fallback from potential method lookup to keyed hash access when dealing with an object. In other words, if <code>$blessed_hash-&gt;do_something()</code> fails, try <code>$blessed_hash-&gt;{do_something}</code>.</p>

<p>... except that that doesn't work when you want to call virtual methods on
unblessed references, such as calling methods on arrays or hashes.</p>

<p>Another option is to change the syntax such that calling a method is visibly different from accessing a member of an aggregate. Perl 5 does this. It works pretty well, in the sense that if you use the right operator (access element versus invoke method), you've expressed your intent in a visually unambiguous fashion).</p>

<p>... except that people complain about the Perl 5 dereferencing arrow quite a
bit. (Okay, you don't <em>need</em> an arrow to do this; as the <a
href="http://onyxneon.com/books/modern_perl/index.html">Modern Perl book</a>
explains, the postfix indexed access or postfix keyed operators of
<code>{}</code> and <code>[]</code> determine the type of operation
effectively.)</p>

<p>... and except that one of the design goals of Template Toolkit was to be
robust in the face of changing values provided to the template, such that it
provides a loosely coupled interface for the data it expects. That's a fine
goal, but it isn't free.</p>

<p>Here's the thing, though. The last time I looked, Template Toolkit compiles
templates into Perl 5 code as an optimization. (The last template system I
wrote did the same thing, but not as well. We should have used TT, but in our
defense, TT didn't exist then.) This transliteration/compilation stage must be
very, very cautious to allow standard Perl debugging and introspection tools to
treat this generated code correctly. That is to say, I don't want to debug a
big wad of generated code. I want to debug the code I actually wrote.</p>

<p>As usual, the solution is another layer of abstraction.</p>

<p>Perl 5 exists in two forms. The first is the source code you and I write.
The second is the optree which the Perl 5 VM executes. There's nothing in
between. You have one or the other. When your code runs, you have the optree,
and the optree has references to the relevant location in the source code it
came from, but the correspondence is often less useful than you might like.</p>

<p>While the generated code from Template Toolkit could include the correct
file and line positions from templates, that's again less useful than you might
like. (It's useful, but it doesn't solve every problem.)</p>

<p>If Perl 5 had instead an intermediate form separate from raw code and raw
optrees, something more suitable to introspection and manipulation, we could
produce tools which worked with this intermediate form to improve debugging,
introspection, and better code generation.</p>

<p>We could even <em>inject</em> new code to add features (fall back to
attribute access; prevent the fallback to attribute access) to code, even
within lexical scopes. That is to say, we could manipulate how libraries behave
from the outside in, and ensure that our changes would not leak out from our
desired scopes.</p>

<p>It's certainly possible to replace the Perl 5 opcodes yourself, if you're
comfortable reading Perl 5 source code, writing XS, relying on black magic, and
dealing with strange issues of thread safety and manipulating global or at
least interpreter-global values in a lexical fashion (while dealing with the
fact that <code>use</code> is recursive in a sense)&mdash;but isn't Perl about
<em>not</em> making people write C to do interesting things?</p>

<p>Certainly this isn't a technique you'd use every day, and it's not obviously
a way to make Perl 5 run faster (though many optimizations become much easier),
but the possibility for better abstraction and extension and correctness has
much to recommend it.</p>

<p>And, yes, Lisp demonstrated this idea <em>ages</em> ago.</p>
        
    ]]></content:encoded>
			<wfw:commentRss>http://perlblogs.com/2012/01/23/a-decades-old-technique-to-improve-programming-languages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visualizing the Perl 5 support policy</title>
		<link>http://www.dagolden.com/index.php/1605/visualizing-the-perl-5-support-policy/</link>
		<comments>http://www.dagolden.com/index.php/1605/visualizing-the-perl-5-support-policy/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 03:43:33 +0000</pubDate>
		<dc:creator>dagolden</dc:creator>
				<category><![CDATA[ironman]]></category>
		<category><![CDATA[p5p]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[perl programming]]></category>

		<guid isPermaLink="false">http://www.dagolden.com/?p=1605</guid>
		<description><![CDATA[My last post showed historical Perl 5 release cycles, but comments I got on and off the blog suggested that my vaguely positive sentiments about the official support policy were misunderstood. This post expands and clarifies my view. I have redone my Perl 5 release cycle graph again with a few changes. First, for the [...]]]></description>
			<content:encoded><![CDATA[<p>My <a href="http://www.dagolden.com/index.php/1587/visualizing-perl-5-release-cycles/" >last post</a> showed historical Perl 5 release cycles, but comments I got on and off the blog suggested that my vaguely positive sentiments about the <a href="http://perldoc.perl.org/perlpolicy.html" >official support policy</a> were misunderstood.  This post expands and clarifies my view.</p>
<p>I have redone my Perl 5 release cycle graph again with a few changes.  First, for the v5.4 through v5.8 series, I have broken the line to the final release, which I consider to be "outliers".  <strong>I think the Perl community was lucky to get those releases</strong> — was lucky that someone stepped up and made them — and that they don't reflect a "normal development" or support cycle.</p>
<p>Second, I have <strong>projected an estimated lifecycle under the official support policy</strong> for v5.12, v5.14 and the not-yet-released v5.16. This represents an expectation for the normal support lifetime of these releases and I think shows a better contrast of expectations resulting from the support policy introduced with v5.14 compared to historical releases.</p>
<p><a href="http://www.dagolden.com/wp-content/uploads/2012/01/perl5-release-timeline-2.png"><img src="http://www.dagolden.com/wp-content/uploads/2012/01/perl5-release-timeline-2-300x214.png" alt="Perl 5 Release Timeline (Amended)" title="perl5-release-timeline-2" width="300" height="214" class="aligncenter size-medium wp-image-1606" /></a></p>
<p class="aligncenter"><em>click for larger view</em></p>
<p>My observations (ignoring outliers):</p>
<ul>
<li><strong>Prior to v5.14, there was a (sometimes lengthy) gap between the end of one stable series and the start of the next.</strong></li>
<li>The actively maintained periods of v5.4, v5.5 and v5.6 were shorter than the proposed support windows under the new policy</li>
<li>v5.8 had two different support paradigms.  Between v5.8.0 and v5.8.1 was a long gap similar to the v5.6 series.  v5.8.1 to v5.8.8 had a more regularly-spaced series of support releases.</li>
<li>v5.10 had the longest gap between initial release (v5.10.0) and the subsequent support release (v5.10.1)</li>
<li>v5.12 has had the most consistent pattern of support releases after the initial release, and is the only stable Perl 5 to have a (regular, not outlier) support release after the release of the next stable version</li>
<li>v5.14 was the first stable Perl 5 released under the new annual-release cycle</li>
</ul>
<p><strong>The new support policy most resembles a return to the best support period seen historically</strong> (v5.8.1 to v5.8.8), but without the subsequent gap to the next stable release.  </p>
<p>Why do I think this new policy is a positive step forward? Here are some reasons:</p>
<ul>
<li>The support policy is <strong>actually written down</strong>.  What expectations did anyone have prior?  I don't know.  But if I'm using Perl 5, I'd rather know what to expect that have to guess and hope for the best.</li>
<li><strong>The new policy offers a support window longer in practice than any Perl 5 except v5.8</strong> and more regular than any period except between v5.8.1 and v5.8.8</li>
<li>The new stable Perl 5 is available for migration testing mid-way through the support window of the prior stable release.  If there are issues with migration, users can be confident of support for their existing version for an additional year (and emergency security support for a year after that).</li>
<li>The annual release cycle means the change between one stable release and the next will be smaller, lowering migration risk</li>
</ul>
<p><strong>The new policy does cut off the "long tail" of expectations for an outlier release</strong>.  I can understand that for some companies or OS packagers, a two-year support window (three for security) might feel too short, even if that is longer than was typically seen historically.</p>
<p>Here is where the annual stable release cycle and monthly development release cycle offer a huge side benefit: there is now a well-documented, frequently-used, regularly-updated <a href="http://perl5.git.perl.org/perl.git/blob/HEAD%3A/Porting/release_managers_guide.pod" title="Release Manager's Guide" >release manager's guide</a> for Perl 5.  Now, <strong>the release process is so easy that a moderately-skilled Perl software engineer without much prior exposure to the Perl source repository can make a Perl 5 release tarball in about a day</strong>.</p>
<p>This means that even if the core Perl 5 development team isn't supporting, say, v5.12 anymore, a motivated company or community group could do the work necessary to prepare their own "outlier" release and either petition the Perl 5 core team to release it or could release their own stable "micro-fork" for others with long-term support needs.  (There might even be a profitable business opportunity selling support for Perl versions past the official support window.)</p>
<p><strong>Previously, Perl 5 development used to be bursty, with long delays between stable releases and with unclear expectations for support.  Now, Perl 5 development happens like clockwork, and has a clear, written support policy.</strong></p>
<p><small><em>[Note: this post represents my individual opinion and was not reviewed by the Perl 5 Porters core development team; it may or may not represent the views of other core developers; it is certainly not an "official" statement of the Perl 5 Porters in any way]</em></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagolden.com/index.php/1605/visualizing-the-perl-5-support-policy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visualizing Perl 5 release cycles</title>
		<link>http://www.dagolden.com/index.php/1587/visualizing-perl-5-release-cycles/</link>
		<comments>http://www.dagolden.com/index.php/1587/visualizing-perl-5-release-cycles/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 17:06:39 +0000</pubDate>
		<dc:creator>dagolden</dc:creator>
				<category><![CDATA[ironman]]></category>
		<category><![CDATA[p5p]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[perl programming]]></category>

		<guid isPermaLink="false">http://www.dagolden.com/?p=1587</guid>
		<description><![CDATA[Beginning with Perl 5, version 12, the Perl 5 language began an annual release cycle, with a new stable release around May of each year. Beginning with version 14, the Perl 5 maintainers also announced a formal support policy and ended support for version 10. This is a significant change from the history of Perl, [...]]]></description>
			<content:encoded><![CDATA[<p>Beginning with Perl 5, version 12, the Perl 5 language began an annual release cycle, with a new stable release around May of each year.  Beginning with version 14, the Perl 5 maintainers also announced a <a href="http://perldoc.perl.org/perlpolicy.html" title="perlpolicy" >formal support policy</a> and ended support for version 10.</p>
<p>This is a significant change from the history of Perl, so I though it would be interesting to see how recent release cycles have compared to historic ones.  The chart below shows releases over time since Perl 5, version 4 when releases were more officially split between "stable" and intermediate releases.</p>
<p><a href="http://www.dagolden.com/wp-content/uploads/2012/01/perl5-release-timeline.png"><img src="http://www.dagolden.com/wp-content/uploads/2012/01/perl5-release-timeline-300x214.png" alt="" title="Perl 5 Release Timeline" width="300" height="214" class="aligncenter size-medium wp-image-1588" /></a></p>
<p class="aligncenter"><em>click for larger view</em></p>
<p>(Note: Starting with version 7, odd numbered versions were reserved for development releases and are omitted above.  Versions 13 and 15 moved to a monthly release cycle for easier community testing of incremental development.)</p>
<p>I think the overall change to a shorter development cycle will benefit both users and maintainers of Perl 5.  For users, each new release will be a smaller change from the previous, lowering upgrade risk, plus they can have confidence in an ongoing process of improvement.  For maintainers, it avoids taking away effort from mainline development to retro-fit patches into a Perl that is many years old and might have substantially different guts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagolden.com/index.php/1587/visualizing-perl-5-release-cycles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl Oasis 2012 wrapup</title>
		<link>http://www.dagolden.com/index.php/1565/perl-oasis-2012-wrapup/</link>
		<comments>http://www.dagolden.com/index.php/1565/perl-oasis-2012-wrapup/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 03:45:32 +0000</pubDate>
		<dc:creator>dagolden</dc:creator>
				<category><![CDATA[conferences]]></category>
		<category><![CDATA[opw]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[perl programming]]></category>

		<guid isPermaLink="false">http://www.dagolden.com/?p=1565</guid>
		<description><![CDATA[Last weekend I attended the Orlando Perl Workshop. While the "hallway track" is one of the best parts of Perl workshops, the talks I saw were also excellent. Here is an overview of the sessions I attended. Doing the Jitterbug Jonathan Leto (dukeleto) presented Jitterbug, a cross language continuous integration tool for git (and written [...]]]></description>
			<content:encoded><![CDATA[<p>Last weekend I attended the Orlando Perl Workshop.  While the "hallway track" is one of the best parts of Perl workshops,  the talks I saw were also excellent.  Here is an overview of the sessions I attended.</p>
<h2>Doing the Jitterbug</h2>
<p>Jonathan Leto (dukeleto) presented <a href="http://jitterbug.pl">Jitterbug</a>, a cross language continuous integration tool for git (and written in Perl).  It's a smaller, lighter tool than Jenkins, though it lacks distributed testing capabilities.  It seems really good for small to medium sized Perl projects, as it already understands how to build and test things with a Makefile.PL or Build.PL.  (<a href="https://github.com/leto/presentations/blob/master/2012/perl_oasis_doing_the_jitterbug/pres.pdf?raw=true">see slides</a> [pdf])</p>
<h2>Javascript is Code</h2>
<p>Jay Shirley (jshirley) gave a non-Perl talk that explained why Javascript tends in practice towards spaghetti code.  He recommended the YUI3 framework and explained why it provides better structure and why it would be familiar to Perl programmers used to Moose.</p>
<h2>A Brave New Perl World</h2>
<p>Stevan Little (stevan) presented some ideas from the work-in-progress prototype of a meta-object protocol (aka MOP) for the Perl 5 core.  I'm really excited by this and I think the design team is finding a pragmatic balance between power and simplicity.</p>
<h2>Tweakers Anonymous</h2>
<p>John Anderson (genehack) gave an editor-agnostic half-rant/half-tutorial about why and how to tweak your editor to be more productive and less repetitive.  There were some good tips that I've already put intro practice, like teaching the editor to automatically "chmod +x" when saving any "*.pl" file. (<a href="http://www.slideshare.net/genehackdotorg/tweakers-anonymous">see slides</a>)</p>
<h2>The First Thing Tak Did - Elegant Remote Control For Sysadmins</h2>
<p>Matt S. Trout (mst) showed an insanely complicated but powerful command line tool to remotely execute any pure Perl code over ssh, without needing any prerequisite modules installed on the remote machine.  It's worth exploring just to understand the magic that makes it work.</p>
<h2>Game Development with Perl &amp; SDL</h2>
<p>Breno Oliveira (garu) gave a playful talk that showed how easy it has become to use Perl to write simple graphical games.  In only a couple dozen lines of code, he demonstrated a simple 2D platform game using the built in physics model. (<a href="http://www.slideshare.net/garux/game-development-with-sdl-and-perl">see slides</a>)</p>
<h2>Cooking Perl with Chef Solo</h2>
<p>This was my talk, where I explained what I've been doing to make it possible to deploy Plack apps using Chef and Perlbrew and friends. (<a href="http://xdg.me/talks/cooking-perl-with-chef/">see slides</a>)</p>
<h2>Lightning talks</h2>
<p>There was the usually assortment of amusing talks, though several presenters thought it would be "fun" to present their 20 minute (or longer) talks in 5 minutes for anyone who missed the original.  (Note to future presenters -- please don't do that.  Pick 5 key slides and just show those.)</p>
<p>The most interesting to me was the lightning talk by Bruce Gray (util), who introduced <a href="http://rosettacode.org/wiki/Rosetta_Code">Rosetta Code</a>, a site that shows how different languages solve hundreds of common programming problems.  He said that Perl needs more solutions written to catch up to other languages, so if you have time and interest then please check it out.</p>
<h2>Keynote</h2>
<p>Cory Watson (gphat) gave a funny talk that in style was nearly worthy of Larry Wall.  It meandered around the broad theme of "diversity" and whether more ways of thinking about things makes one smarter.  It eventually circled back to Perl, but the overall call to action was to get out of the usual comfort zones and try something you haven't done before and aren't good at -- whether radical or minor -- in order to stretch your brain. (I can't do it justice in text -- I think you had to be there.)</p>
<h2>Hackathon</h2>
<p>On Sunday, I went for brunch with some other attendees and then parked myself at the hackathon until it was time to leave for the airport.  While I was there, I sucessfully ported my auto-install CD creation tools to work on Debian ISOs instead of just Ubuntu ISOs, so I can test my Perl/Chef tools on that server platform as well.</p>
<h2>Coda</h2>
<p>As a final note, Chris Prather (perigrin) -- who appeared ably supported by his family -- put on an excellent conference and I want to thank him for the work that went into it.  I hope I can attend again in 2013 and recommend it to anyone who wants to get away and have some fun with Perl in the dark of January.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagolden.com/index.php/1565/perl-oasis-2012-wrapup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Little Bit is A Lot Better</title>
		<link>http://www.modernperlbooks.com/mt/2012/01/a-little-bit-is-a-lot-better.html</link>
		<comments>http://www.modernperlbooks.com/mt/2012/01/a-little-bit-is-a-lot-better.html#comments</comments>
		<pubDate>Mon, 09 Jan 2012 19:48:51 +0000</pubDate>
		<dc:creator>chromatic</dc:creator>
				<category><![CDATA[cpan]]></category>
		<category><![CDATA[modernperl]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://perlblogs.com/?guid=4df8a55681ff0ae28421e912d885fdee</guid>
		<description><![CDATA[Buddy Burden explanation of taking over maintenance of CPAN distributions is important. It's empowering. If you've ever thought &#34;I should contribute something to Perl&#34;, start there. You can do it. Sure, it's easy for me to say that. I've written...]]></description>
			<content:encoded><![CDATA[
        <p><a href="http://blogs.perl.org/mt/mt-cp.fcgi?__mode=view&id=1580">Buddy Burden</a> explanation of <a href="http://blogs.perl.org/users/buddy_burden/2012/01/stepping-up.html">taking over maintenance of CPAN distributions</a> is important. It's empowering. If you've ever thought "I should contribute something to Perl", start there.</p>

<p>You can do it.</p>

<p>Sure, it's easy for <em>me</em> to say that. I've written a few things about
Perl a few people have read. I have a few patches in a few projects and a
couple of modules on the CPAN myself. (You're reading this, aren't you? So I
have at least one reader. Thank you for your time!)</p>

<p>Even with all that in mind, two questions still come up far too often, and I think they prevent or delay us from providing code and documentation for other people to use freely:</p>

<ul>

<li>Does anyone care?</li>

<li>Is it good enough (yet)?</li>

</ul>

<p>You can see this attitude in the recurring debate over the responsibilities of authors. While some people say it's irresponsible or childish or unprofessional to upload code without full test coverage or complete documentation or an iron-clad promise to respond to every bug within 24 hours with a fix, an apology, a new release, and a sandwich (and yes, I exaggerate for effect), we're doing each other a disservice setting these demands on ourselves and each other.</p>

<p><em>Yes</em>, we should do our best.</p>

<p>... but <em>yes</em>, we can start from something small and incomplete and
refine it in smaller steps. It doesn't have to pass every test on every
platform known to man if you can get feedback on where it fails and release a
new version tomorrow. It doesn't have to have every feature you plan to add, if
it does something useful that other people might want to use today. It doesn't
have to have every option documented if it's usable right now.</p>

<p>I'm not suggesting that we allow ourselves to be irresponsible with what we
share, but I am suggesting that we can allow ourselves the freedom to share a
little earlier and a little more often. We have the ability to upload new code
every day (every hour!) if we want.</p>

<p>So what if it's not perfect? Even if you waited until you thought you'd achieved perfect, you probably would miss, even by a little bit.</p>

<p>Start small. Do your research&mdash;work to your best quality&mdash;but let yourself hit smaller goals and make things a little bit better a little more often. Share earlier. This is a lot better for everyone.</p>
        
    ]]></content:encoded>
			<wfw:commentRss>http://perlblogs.com/2012/01/09/a-little-bit-is-a-lot-better/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modern::Perl Updates</title>
		<link>http://www.modernperlbooks.com/mt/2012/01/modernperl-updates.html</link>
		<comments>http://www.modernperlbooks.com/mt/2012/01/modernperl-updates.html#comments</comments>
		<pubDate>Thu, 05 Jan 2012 20:34:04 +0000</pubDate>
		<dc:creator>chromatic</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[cpan]]></category>
		<category><![CDATA[modernperl]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[perl5]]></category>

		<guid isPermaLink="false">http://perlblogs.com/?guid=e111c8530c409abb316f409fa5f73041</guid>
		<description><![CDATA[The Modern::Perl CPAN distribution is much more conservative than I think most people thought it would be when I first released it. (Count me in that group.) Where I once intended to collect a bunch of useful CPAN modules in...]]></description>
			<content:encoded><![CDATA[
        <p>The <a href="http://search.cpan.org/perldoc?Modern::Perl">Modern::Perl</a> CPAN distribution is much more conservative than I think most people thought it would be when I first released it. (Count me in that group.) Where I once intended to collect a bunch of useful CPAN modules in the style of <a href="http://search.cpan.org/perldoc?Task::Kensho">Task::Kensho</a> or <a href="http://search.cpan.org/perldoc?perl5i">perl5i</a>, both of those do what they do far better than I can do.</p>

<p>Instead, I see Modern::Perl as enabling the core features I wish were on out
of the box by default in Perl 5. While it'd be nice to pull in <a
href="http://search.cpan.org/perldoc?Try::Tiny">Try::Tiny</a> and sometimes I
might wish for fatal warnings, the former is not a core module and the second
isn't something I use in every program.</p>

<p>Consequently the module hasn't needed much maintenance. Yet I've added a couple of missing features that should keep it useful and usable into the
future. I uploaded a new version yesterday and will upload one more today with a little bit more polish.</p>

<p>First, it now requires <a
href="http://search.cpan.org/perldoc?autodie">autodie</a> as a distribution
dependency. It doesn't <em>load</em> <code>autodie</code>, but installing
Modern::Perl on 5.10.0 will also install <code>autodie</code>. (Anything 5.10.1
and newer includes <code>autodie</code> in the core.) You don't have to use it,
but now you can rely on any Perl considered modern to have <code>autodie</code>
available.</p>

<p>Second, it now loads <a
href="http://search.cpan.org/perldoc?IO::File">IO::File</a> and <a
href="http://search.cpan.org/perldoc?IO::Handle">IO::Handle</a> so that you can
call methods on lexical filehandles without having to load either manually.
Perl 5.14 fixed that usability niggle, but Modern::Perl fixes this for people
using 5.10 or 5.12. (Why both? I can never remember which one superseded the
other in 5.12, but better safe than sorry. I welcome a patch to load one over
the other with a version check&mdash;and please test carefully.)</p>

<p>Third, I added unimporting support so that you can write <code>no
Modern::Perl;</code> within a scope to disable strictures, warnings, and
language bundle features. It's an all or nothing switch and will remain that
way, but I can see this being useful in specific cases, especially when
updating older code in stages.</p>

<p>Finally I added date support to importing. If you write <code>use
Modern::Perl;</code> you'll get the features of Perl 5.10 (with the caveat that
if you're using Perl 5.11.3 or newer, you also get the
<code>unicode_strings</code> feature, of which all you're likely to notice is
that Unicode strings work better in more places).</p>

<p>Yet for forward compatibility, you should be using:</p>

<pre><code>use Modern::Perl 2012;</code></pre>

<p>... which enables 5.14 features. You can use 2009 and 2010 to get 5.10
features and 2011 to get 5.12 features. If you use the wrong date on the wrong
version of Perl 5, you'll get an error, which is as it should be.</p>

<p>Next year I'm likely to drop support for Perl 5.10, in which case you'll
probably get an error message that that year isn't modern enough, but I could
be convinced to do a version check instead. I haven't decided. The tradeoff is
between providing a minimal module suitable for use in programs which helps
people write better code from the start and between telling people what they
should and shouldn't use. Besides all that, the relevant code is only a couple of dozen lines of very simple Perl. Anyone reading this can reimplement it almost trivially.</p>

<p>Of course, this all comes about because the <a
href="http://onyxneon.com/books/modern_perl/index.html">Modern Perl book</a>
goes to the printer today. We're very proud of the new 2011-2012 edition which
concentrates on Perl 5.12 and Perl 5.14. It addresses all of the known typos
and confusing parts of the previous edition, covers new features in Perl 5.14,
and is, from all reports, even better than the first edition.</p>

<p>The book should be in stores in the next week or so, and we'll have
electronic editions up this month for free download and redistribution. (We
hope you tell lots of people to buy the print edition because it's great and
more people need it on their desks, but sharing is caring and we support
that.)</p>
        
    ]]></content:encoded>
			<wfw:commentRss>http://perlblogs.com/2012/01/05/modernperl-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Do It Wrong Sometimes</title>
		<link>http://www.modernperlbooks.com/mt/2012/01/do-it-wrong-sometimes.html</link>
		<comments>http://www.modernperlbooks.com/mt/2012/01/do-it-wrong-sometimes.html#comments</comments>
		<pubDate>Tue, 03 Jan 2012 22:14:17 +0000</pubDate>
		<dc:creator>chromatic</dc:creator>
				<category><![CDATA[cpan]]></category>
		<category><![CDATA[modernperl]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[skunkworks]]></category>

		<guid isPermaLink="false">http://perlblogs.com/?guid=0b504cc8284bd3b38992db8dc0ebfd6f</guid>
		<description><![CDATA[The YAPC::NA 2012 call for presentations has opened! As with every YAPC I've attended, this is a great opportunity to meet other programmers, learn things you know better and don't know yet, and to practice your presentation skills. A few...]]></description>
			<content:encoded><![CDATA[
        <p>The <a href="http://act.yapcna.org/2012/">YAPC::NA 2012</a> call for presentations has opened! As with every YAPC I've attended, this is a great opportunity to meet other programmers, learn things you know better and don't know yet, and to practice your presentation skills.</p>

<p>A few months ago I exchanged emails with <a href="http://www.plainblack.com/">JT Smith</a> about my idea for a talk this year. I've mentioned in passing a few times <a href="http://www.modernperlbooks.com/mt/2011/08/why-my-side-project-doesnt-use-perl-6.html">a small side project my business is investing in</a>. It's a side project, deliberately minimal, and&mdash;from the development side&mdash;definitely the kind of skunkworks, just get it working, maintain it as little as possible and let it run uninterrupted software that you're likely to find.</p>

<p>That doesn't mean it's quick or dirty. That doesn't mean it's not tested well, or that it has a slapdash design. All it means is that the most important criterion for any design or implementation decision is "is this the simplest thing that could possibly work" instead of "is this elegant" or "what's the standard modern Perl orthodoxy for this problem".</p>

<p>So far the results have been enlightening.</p>

<p>I don't want to give away too many of the details of my talk (if it's accepted), but here are two small hints which may or may not help you.</p>

<p>First, just because a good ORM such as <a href="http://search.cpan.org/perldoc?DBIx::Class">DBIx::Class</a> makes searching and manipulating existing data easy doesn't make it the best way to insert big batches of new data.</p>

<p>Second, while <a href="http://search.cpan.org/perldoc?LWP">LWP</a> and especially <a href="http://search.cpan.org/perldoc?WWW::Mechanize">WWW::Mechanize</a> are great tools for automating the behavior of a web client, sometimes <code>wget</code> or <code>curl</code> in a shell script is quicker, easier to parallelize, and more robust.</p>

<p>(As a bonus, consider also that if you're parsing semi-structured data out of HTML that removing <em>all</em> of the HTML is sometimes even easier than using a real HTML parser or even CSS selectors. Sure, semantic markup helps when you can rely on it, and sure, using a regex to remove HTML tags is a bad idea, but there are ways to turn HTML into plain text quickly and easily without doing anything on your own.)</p>
        
    ]]></content:encoded>
			<wfw:commentRss>http://perlblogs.com/2012/01/04/do-it-wrong-sometimes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

