<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0">
    <title>Modern Perl Books for modern Perl programming — comments</title>
    <id>tag:www.modernperlbooks.com,2011-06-07:/mt//comments</id>
    <updated>2012-05-16T22:41:07Z</updated>
    <link rel="self" href="http://www.modernperlbooks.com/mt/comments.xml" />
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.23-en</generator>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.447-comment:1297</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.447-comment:1286" type="text/html" href="http://www.modernperlbooks.com/mt/2012/05/write-the-wrong-code-first.html#comment-1286"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/05/write-the-wrong-code-first.html#comment-1297" />
    <title>Re: Write the Wrong Code First — From: chromatic</title>
    <author>
        <name>chromatic</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Unfortunately I can no longer ignore IE 8. Fortunately, I think I've found a workaround that only requires a couple of lines of code.</p>]]>
    </content>
    <published>2012-05-16T22:41:07Z</published>
    <updated>2012-05-16T22:41:07Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.449-comment:1296</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.449" type="text/html" href="http://www.modernperlbooks.com/mt/2012/05/separating-presentation-from-content-in-templates.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/05/separating-presentation-from-content-in-templates.html#comment-1296" />
    <title>Re: Separating Presentation from Content in Templates — From: https://me.yahoo.com/a/evZh.8gAt5qa1xDbY_dE.iSYdbI-#2dbce</title>
    <author>
        <name>https://me.yahoo.com/a/evZh.8gAt5qa1xDbY_dE.iSYdbI-#2dbce</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Hey,</p>

<p>As one of the people asking for a code sample, THANKS!</p>

<p>I understand your 'no love lost' over the named block thing.  I took a similar approach last time I wrote a layout system for TT (I guess I should have published it since it was quite similar to bootstrap).  Lately I've played with using filters instead.  I did a toy app using Catalyst that took this approach, and this is a very early prototype, but the View is defined here: <a href="https://github.com/jjn1056/Shutterstock-Exchange/blob/master/lib/Shutterstock/Exchange/Web/View/HTML.pm">https://github.com/jjn1056/Shutterstock-Exchange/blob/master/lib/Shutterstock/Exchange/Web/View/HTML.pm</a> and the actual code is pulled over from a application model ( here: "https://github.com/jjn1056/Shutterstock-Exchange/blob/master/lib/Shutterstock/Exchange/ListQuestions.pm")</p>

<p>The Template is here: <a href="https://github.com/jjn1056/Shutterstock-Exchange/blob/master/share/html/index.tt#L30">https://github.com/jjn1056/Shutterstock-Exchange/blob/master/share/html/index.tt#L30</a></p>

<p>This is probably almost exactly not what I really but, but the tiny part that is, is some progress for me :)</p>

<p>Thanks!<br />
</p>]]>
    </content>
    <published>2012-05-15T03:22:18Z</published>
    <updated>2012-05-15T03:22:18Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.442-comment:1295</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.442" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/embrace-the-little-conveniences.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/embrace-the-little-conveniences.html#comment-1295" />
    <title>Re: Embrace the Little Conveniences — From: barefootcoder.myopenid.com</title>
    <author>
        <name>barefootcoder.myopenid.com</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Interesting.  I have to say I still prefer the interface of Perl6::Slurp though.  But good summary!</p>]]>
    </content>
    <published>2012-05-14T22:27:19Z</published>
    <updated>2012-05-14T22:27:19Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.449-comment:1294</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.449" type="text/html" href="http://www.modernperlbooks.com/mt/2012/05/separating-presentation-from-content-in-templates.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/05/separating-presentation-from-content-in-templates.html#comment-1294" />
    <title>Re: Separating Presentation from Content in Templates — From: http://openid.anonymity.com/2a3n8o</title>
    <author>
        <name>http://openid.anonymity.com/2a3n8o</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Template::Semantic gives a good separation of html from perl code, which is useful in team developement.</p>]]>
    </content>
    <published>2012-05-14T19:32:45Z</published>
    <updated>2012-05-14T19:32:45Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.447-comment:1293</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.447" type="text/html" href="http://www.modernperlbooks.com/mt/2012/05/write-the-wrong-code-first.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/05/write-the-wrong-code-first.html#comment-1293" />
    <title>Re: Write the Wrong Code First — From: asknet999.myopenid.com</title>
    <author>
        <name>asknet999.myopenid.com</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>I completely agree with your post. Most of the software problems are wicked. you have to solve once to understand it better. Once I understood this, I stopped dreaming of writing a perfect software. I mean it won't happen in first attempt.</p>

<p>"There is no great writing, only great rewriting" - Louis Brandeis</p>]]>
    </content>
    <published>2012-05-14T17:06:00Z</published>
    <updated>2012-05-14T17:06:00Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.448-comment:1292</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.448" type="text/html" href="http://www.modernperlbooks.com/mt/2012/05/simple-attribute-based-template-exporting.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/05/simple-attribute-based-template-exporting.html#comment-1292" />
    <title>Re: Simple Attribute-Based Template Exporting — From: https://me.yahoo.com/a/evZh.8gAt5qa1xDbY_dE.iSYdbI-#2dbce</title>
    <author>
        <name>https://me.yahoo.com/a/evZh.8gAt5qa1xDbY_dE.iSYdbI-#2dbce</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>I'd like to see that as well.  I've also been playing with abuse TT with filters and HTML:Zoom and I'm very curious.</p>

<p>John</p>]]>
    </content>
    <published>2012-05-14T13:56:47Z</published>
    <updated>2012-05-14T13:56:47Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.448-comment:1291</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.448" type="text/html" href="http://www.modernperlbooks.com/mt/2012/05/simple-attribute-based-template-exporting.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/05/simple-attribute-based-template-exporting.html#comment-1291" />
    <title>Re: Simple Attribute-Based Template Exporting — From: robmueller.myopenid.com</title>
    <author>
        <name>robmueller.myopenid.com</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>I did something similar for our web application to mark which methods were publicly accessible.</p>

<p>I tried Attribute::Handlers, but it didn't work under mod_perl2 because CHECK and INIT aren't run, and BEGIN is too early.</p>

<p>In the end I just wrote my own MODIFY_CODE_ATTRIBUTES sub. It's actually pretty trivial to write your own. See perldoc attributes for details.</p>]]>
    </content>
    <published>2012-05-14T12:03:15Z</published>
    <updated>2012-05-14T12:03:15Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.448-comment:1290</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.448" type="text/html" href="http://www.modernperlbooks.com/mt/2012/05/simple-attribute-based-template-exporting.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/05/simple-attribute-based-template-exporting.html#comment-1290" />
    <title>Re: Simple Attribute-Based Template Exporting — From: autarch.urth.org</title>
    <author>
        <name>autarch.urth.org</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>It'd be interesting to see how a template looks uses these functions.<br />
</p>]]>
    </content>
    <published>2012-05-12T03:19:13Z</published>
    <updated>2012-05-12T03:19:13Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2010:/mt//1.222-comment:1289</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2010:/mt//1.222" type="text/html" href="http://www.modernperlbooks.com/mt/2010/08/backporting-features.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2010/08/backporting-features.html#comment-1289" />
    <title>Re: Backporting Features — From: Aristotle Pagaltzis</title>
    <author>
        <name>Aristotle Pagaltzis</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Your time writing a reply was wasted, you fell for a cheap spammer trick. Check the link.</p>]]>
    </content>
    <published>2012-05-11T01:01:47Z</published>
    <updated>2012-05-11T01:01:47Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2010:/mt//1.222-comment:1288</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2010:/mt//1.222-comment:1287" type="text/html" href="http://www.modernperlbooks.com/mt/2010/08/backporting-features.html#comment-1287"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2010/08/backporting-features.html#comment-1288" />
    <title>Re: Backporting Features — From: chromatic</title>
    <author>
        <name>chromatic</name>
        <uri>http://www.wgz.org/~chromatic</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.wgz.org/~chromatic">
        <![CDATA[<p>There's no real namespace distinction between keywords and user-defined functions. If you add a keyword with the same name as someone's user-defined function, you can break their code in odd ways if they run it on a new version.</p>]]>
    </content>
    <published>2012-05-10T18:35:08Z</published>
    <updated>2012-05-10T18:35:08Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2010:/mt//1.222-comment:1287</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2010:/mt//1.222" type="text/html" href="http://www.modernperlbooks.com/mt/2010/08/backporting-features.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2010/08/backporting-features.html#comment-1287" />
    <title>Re: Backporting Features — From: gabrielle03.myopenid.com</title>
    <author>
        <name>gabrielle03.myopenid.com</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>What does it not allowed adding keywords.<br />
Too bad-- i like using keyword instead,<br />
its easier for me.</p>]]>
    </content>
    <published>2012-05-10T10:56:06Z</published>
    <updated>2012-05-10T10:56:06Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.447-comment:1286</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.447-comment:1285" type="text/html" href="http://www.modernperlbooks.com/mt/2012/05/write-the-wrong-code-first.html#comment-1285"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/05/write-the-wrong-code-first.html#comment-1286" />
    <title>Re: Write the Wrong Code First — From: michaelrpdx.myopenid.com</title>
    <author>
        <name>michaelrpdx.myopenid.com</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>I'll try to contain my envy.  HTML5 provides so much good stuff. Coding for IE8 has consumed over half of my dev time and the results look worse. </p>]]>
    </content>
    <published>2012-05-10T00:33:33Z</published>
    <updated>2012-05-10T00:33:33Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.447-comment:1285</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.447-comment:1284" type="text/html" href="http://www.modernperlbooks.com/mt/2012/05/write-the-wrong-code-first.html#comment-1284"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/05/write-the-wrong-code-first.html#comment-1285" />
    <title>Re: Write the Wrong Code First — From: chromatic</title>
    <author>
        <name>chromatic</name>
        <uri>http://www.wgz.org/~chromatic</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.wgz.org/~chromatic">
        <![CDATA[<p>I can happily ignore IE8 and worse. The web component gladly embraces HTML 5.</p>]]>
    </content>
    <published>2012-05-09T21:02:50Z</published>
    <updated>2012-05-09T21:02:50Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.447-comment:1284</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.447" type="text/html" href="http://www.modernperlbooks.com/mt/2012/05/write-the-wrong-code-first.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/05/write-the-wrong-code-first.html#comment-1284" />
    <title>Re: Write the Wrong Code First — From: michaelrpdx.myopenid.com</title>
    <author>
        <name>michaelrpdx.myopenid.com</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>SVG as template?  Acghh, arck, YES. <br />
Well that makes a situation at work a lot easier.</p>

<p>Do some of your target audience use IE8 or below?  It doesn't do well with SVG.</p>]]>
    </content>
    <published>2012-05-09T20:59:59Z</published>
    <updated>2012-05-09T20:59:59Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.442-comment:1283</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.442" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/embrace-the-little-conveniences.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/embrace-the-little-conveniences.html#comment-1283" />
    <title>Re: Embrace the Little Conveniences — From: http://openid.tobyinkster.co.uk/tobyink</title>
    <author>
        <name>http://openid.tobyinkster.co.uk/tobyink</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p><a href="https://metacpan.org/requires/distribution/File-Slurp">File::Slurp</a> is more widely used than <a href="https://metacpan.org/requires/distribution/Perl6-Slurp">Perl6::Slurp</a> which means that there's a much better chance that File::Slurp will already be installed on the target system than Perl6::Slurp.</p>

<p>File::Slurp also happens to come with some other handy functions. I've recently become a big fan of edit_file_lines, which is a bit like doing a map over each line in a file.</p>]]>
    </content>
    <published>2012-05-09T20:01:49Z</published>
    <updated>2012-05-09T20:01:49Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.442-comment:1282</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.442" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/embrace-the-little-conveniences.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/embrace-the-little-conveniences.html#comment-1282" />
    <title>Re: Embrace the Little Conveniences — From: barefootcoder.myopenid.com</title>
    <author>
        <name>barefootcoder.myopenid.com</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>I always use Perl6::Slurp ... do you think File::Slurp is better? if so, how?</p>]]>
    </content>
    <published>2012-05-02T21:31:29Z</published>
    <updated>2012-05-02T21:31:29Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.437-comment:1281</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.437-comment:1280" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/mock-objects-despoil-your-tests.html#comment-1280"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/mock-objects-despoil-your-tests.html#comment-1281" />
    <title>Re: Mock Objects Despoil Your Tests — From: chromatic</title>
    <author>
        <name>chromatic</name>
        <uri>http://www.wgz.org/~chromatic</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.wgz.org/~chromatic">
        <![CDATA[<p>I know how this is going to sound (and I know it's not always possible), but in my recent projects I've tried to make it as easy as possible to create a real B and use that. I've been fortunate that these projects are relatively small and young.</p>

<p>With that said, every time I've started with mock objects in the tests (for the reason you suggest), I've regretted it and have refactored dependencies to be able to use real objects. Maybe my rule is best phrased as a goal of refactoring: as few mock objects in the tests as possible.</p>]]>
    </content>
    <published>2012-05-02T18:30:20Z</published>
    <updated>2012-05-02T18:30:20Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.437-comment:1280</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.437" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/mock-objects-despoil-your-tests.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/mock-objects-despoil-your-tests.html#comment-1280" />
    <title>Re: Mock Objects Despoil Your Tests — From: barefootcoder.myopenid.com</title>
    <author>
        <name>barefootcoder.myopenid.com</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>You didn't mention the primary (almost only?) reason I use mock objects:</p>

<ul><li>I want to test some behavior of an A.
<li>In order to instantiate an A, I need a B (dependent data, uses-a relationship, whatever).
<li>I don't care about B (after all, I'm testing <i>A</i>), so I mock it.</li></li></li></ul>

<p>Could be B is a PITA to create, or I just don't want to risk changes (or breakage) in B to screw up my tests, or whatever.  Even so, if changes (or breakage) in B <i>could</i> screw up my tests, maybe they <i>should</i> fail (if they'll screw up my tests, why wouldn't they screw up my code?).  Basically, I use mock objects as a last resort, and I never mock the actual thing I'm testing.</p>

<p>So I think I mostly agree with you.</p>]]>
    </content>
    <published>2012-05-01T23:51:31Z</published>
    <updated>2012-05-01T23:51:31Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.444-comment:1279</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.444-comment:1278" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/picking-functional-programmings-pockets.html#comment-1278"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/picking-functional-programmings-pockets.html#comment-1279" />
    <title>Re: Picking Functional Programming&apos;s Pockets — From: chromatic</title>
    <author>
        <name>chromatic</name>
        <uri>http://www.wgz.org/~chromatic</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.wgz.org/~chromatic">
        <![CDATA[<p>That was a typo. I retyped code instead of copying and pasting and editing it.</p>]]>
    </content>
    <published>2012-05-01T17:27:12Z</published>
    <updated>2012-05-01T17:27:12Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.444-comment:1278</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.444" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/picking-functional-programmings-pockets.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/picking-functional-programmings-pockets.html#comment-1278" />
    <title>Re: Picking Functional Programming&apos;s Pockets — From: https://me.yahoo.com/moleculasdevida#fea03</title>
    <author>
        <name>https://me.yahoo.com/moleculasdevida#fea03</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Was this what you meant for updating the market capitalization?</p>

<p>$updates->{market_capitalization} = $stats->{market_capitalization};</p>

<p>Or was that intentional to remind us how easy it is to make mistakes and therefore need to test our code?</p>

<p>Either way, great post. Thanks</p>]]>
    </content>
    <published>2012-05-01T11:55:09Z</published>
    <updated>2012-05-01T11:55:09Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.442-comment:1277</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.442-comment:1276" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/embrace-the-little-conveniences.html#comment-1276"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/embrace-the-little-conveniences.html#comment-1277" />
    <title>Re: Embrace the Little Conveniences — From: chromatic</title>
    <author>
        <name>chromatic</name>
        <uri>http://www.wgz.org/~chromatic</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.wgz.org/~chromatic">
        <![CDATA[<p>I'd better stop stealing your thunder then!</p>]]>
    </content>
    <published>2012-04-26T19:59:09Z</published>
    <updated>2012-04-26T19:59:09Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.442-comment:1276</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.442" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/embrace-the-little-conveniences.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/embrace-the-little-conveniences.html#comment-1276" />
    <title>Re: Embrace the Little Conveniences — From: stephen.scaffidi.name</title>
    <author>
        <name>stephen.scaffidi.name</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>This is one of the main points of <a href="http://act.yapcna.org/2012/talk/85">my YAPC::NA talk</a> this year! In fact, <a href="https://metacpan.org/module/File::Slurp">File::Slurp</a> and <a href="https://metacpan.org/module/Proc::Fork">Proc::Fork</a> are both on my list of essentials!</p>]]>
    </content>
    <published>2012-04-26T16:31:14Z</published>
    <updated>2012-04-26T16:31:14Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.439-comment:1275</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.439" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/method-function-equivalence-strikes-again.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/method-function-equivalence-strikes-again.html#comment-1275" />
    <title>Re: Method-Function Equivalence Strikes Again! — From: Aristotle Pagaltzis</title>
    <author>
        <name>Aristotle Pagaltzis</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>I guess you could make something like</p>

<pre>croak 'Incorrect class method call "make_bounded_regex"'
    if ref $class
    or not $class-&gt;isa( __PACKAGE__ );
</pre>

<p>part of a function → class method transition, to be taken out at a later date, as insurance against incomplete refactoring. But that does not exactly <em>“solve”</em> the problem.</p>]]>
    </content>
    <published>2012-04-25T17:28:49Z</published>
    <updated>2012-04-25T17:28:49Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.440-comment:1274</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.440-comment:1273" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/dependencies-minimizers-and-regressing-to-javascript.html#comment-1273"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/dependencies-minimizers-and-regressing-to-javascript.html#comment-1274" />
    <title>Re: Dependencies, Minimizers, and Regressing to JavaScript — From: chromatic</title>
    <author>
        <name>chromatic</name>
        <uri>http://www.wgz.org/~chromatic</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.wgz.org/~chromatic">
        <![CDATA[<p>I remember discussing what would become Module::Install with Ingy, in my living room.</p>

<p>The thing is, you're writing software for people to install. If you do that, it makes no sense to me to worry that they can't or won't install software. The people who can't or won't install software won't install the software you're writing! This use case contradicts itself.</p>]]>
    </content>
    <published>2012-04-21T08:17:53Z</published>
    <updated>2012-04-21T08:17:53Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.440-comment:1273</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.440" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/dependencies-minimizers-and-regressing-to-javascript.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/dependencies-minimizers-and-regressing-to-javascript.html#comment-1273" />
    <title>Re: Dependencies, Minimizers, and Regressing to JavaScript — From: https://me.yahoo.com/mithaldu#29f3a</title>
    <author>
        <name>https://me.yahoo.com/mithaldu#29f3a</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>>  I'll probably never understand</p>

<p>Did you, like, go and ask ingy? He's a person one can communicate with.</p>]]>
    </content>
    <published>2012-04-21T04:46:05Z</published>
    <updated>2012-04-21T04:46:05Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.440-comment:1272</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.440-comment:1271" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/dependencies-minimizers-and-regressing-to-javascript.html#comment-1271"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/dependencies-minimizers-and-regressing-to-javascript.html#comment-1272" />
    <title>Re: Dependencies, Minimizers, and Regressing to JavaScript — From: chromatic</title>
    <author>
        <name>chromatic</name>
        <uri>http://www.wgz.org/~chromatic</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.wgz.org/~chromatic">
        <![CDATA[<p>Global <em>and</em> function scope is slightly better than only global scope.</p>

<p>You're right about the source of the library management problem.</p>]]>
    </content>
    <published>2012-04-20T22:37:10Z</published>
    <updated>2012-04-20T22:37:10Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.440-comment:1271</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.440" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/dependencies-minimizers-and-regressing-to-javascript.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/dependencies-minimizers-and-regressing-to-javascript.html#comment-1271" />
    <title>Re: Dependencies, Minimizers, and Regressing to JavaScript — From: jnareb.myopenid.com</title>
    <author>
        <name>jnareb.myopenid.com</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Errr... what better lexicals?  JavaScript has only global and function scope (and "hoisting" variables declarations).</p>

<p>As for lack of CPAN - it is hard to have one without include/require/use...</p>]]>
    </content>
    <published>2012-04-20T22:19:04Z</published>
    <updated>2012-04-20T22:19:04Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.440-comment:1270</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.440" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/dependencies-minimizers-and-regressing-to-javascript.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/dependencies-minimizers-and-regressing-to-javascript.html#comment-1270" />
    <title>Re: Dependencies, Minimizers, and Regressing to JavaScript — From: Caleb Cushing ( xenoterracide )</title>
    <author>
        <name>Caleb Cushing ( xenoterracide )</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>some generated code is good, see some of the things you can do with Dist::Zilla, and which is akin to what the Pragmatic Programmer mentions. but I agree that simply duplicating an entire distribution is not a great idea, that's not really the same distributing generated code. It's outright redistributing someone elses code, without the intent to fork and maintain for a different purpose.</p>]]>
    </content>
    <published>2012-04-20T20:40:12Z</published>
    <updated>2012-04-20T20:40:12Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.438-comment:1269</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.438-comment:1268" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/debuggability-driven-design.html#comment-1268"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/debuggability-driven-design.html#comment-1269" />
    <title>Re: Debuggability-Driven Design — From: chromatic</title>
    <author>
        <name>chromatic</name>
        <uri>http://www.wgz.org/~chromatic</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.wgz.org/~chromatic">
        <![CDATA[<p>There's remembering where to look to find out what happened and there's designing it so you don't have to remember. My experience in programming has been learning the hard way to do the latter.</p>]]>
    </content>
    <published>2012-04-18T06:01:35Z</published>
    <updated>2012-04-18T06:01:35Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.438-comment:1268</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.438" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/debuggability-driven-design.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/debuggability-driven-design.html#comment-1268" />
    <title>Re: Debuggability-Driven Design — From: https://me.yahoo.com/a/HBbJpZot0JlBDMpPmi1O7_HYkkE-#6f394</title>
    <author>
        <name>https://me.yahoo.com/a/HBbJpZot0JlBDMpPmi1O7_HYkkE-#6f394</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Well that's what you get for knowing what you're doing.  I'm still more<br />
comfortable with Bash and Vim than with Perl, so my "solution" would be a shell<br />
script calling a jumble of 'wgets', tr's, sed one-liners, and Vim :bufdo's<br />
having their various ways with a few hundred download files, intermediate<br />
files, and output files with suffixes like 'html', '.folded' and '.rstripped'.</p>

<p>Like that time I scraped the librarything.com site for the ISBN numbers of my<br />
own books so I could let my computer find out what they were selling for used<br />
at Amazon....</p>

<p>Anyway, the one thing I can say for my way (besides I know how to do it) is it<br />
exposes the guts of the process in a way that makes it easy to know where to<br />
look if something goes wrong.  And, as you touch on, I can fire it back up<br />
again at any point in the process if it gets interrupted.  Also, nobody can<br />
accuse me of premature optimization, and the jerry-rigged look of the thing<br />
highlights rather than obscures the fact that I'm using "API's" that are really<br />
no such thing; the hack looks like a hack.</p>

<p>I guess that's actually more than one thing I can say for it.<br />
</p>]]>
    </content>
    <published>2012-04-18T01:48:41Z</published>
    <updated>2012-04-18T01:48:41Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.437-comment:1267</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.437-comment:1266" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/mock-objects-despoil-your-tests.html#comment-1266"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/mock-objects-despoil-your-tests.html#comment-1267" />
    <title>Re: Mock Objects Despoil Your Tests — From: chromatic</title>
    <author>
        <name>chromatic</name>
        <uri>http://www.wgz.org/~chromatic</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.wgz.org/~chromatic">
        <![CDATA[<p>Nothing rigorous. How would you collect that across the body of tested code? Most of it's not visible. How would you measure whether mocked code is more fragile than unmocked code such that you can compare fragility across projects?</p>

<p>I can only report what I've seen.</p>]]>
    </content>
    <published>2012-04-15T17:23:10Z</published>
    <updated>2012-04-15T17:23:10Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.437-comment:1266</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.437" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/mock-objects-despoil-your-tests.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/mock-objects-despoil-your-tests.html#comment-1266" />
    <title>Re: Mock Objects Despoil Your Tests — From: kid51</title>
    <author>
        <name>kid51</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>chromatic wrote:<br />
<blockquote><i><br />
"Yet in truth, mock objects are far, far overused."<br />
</i></blockquote><br />
Do you have empirical evidence for this?</p>]]>
    </content>
    <published>2012-04-15T13:50:26Z</published>
    <updated>2012-04-15T13:50:26Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.437-comment:1265</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.437-comment:1264" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/mock-objects-despoil-your-tests.html#comment-1264"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/mock-objects-despoil-your-tests.html#comment-1265" />
    <title>Re: Mock Objects Despoil Your Tests — From: chromatic</title>
    <author>
        <name>chromatic</name>
        <uri>http://www.wgz.org/~chromatic</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.wgz.org/~chromatic">
        <![CDATA[<p>My point is that the use of mock objects is a code smell.</p>

<p>If every unit (or most units) need mock objects for you to test them to your satisfaction, your tests are likely fragile.</p>]]>
    </content>
    <published>2012-04-14T07:33:35Z</published>
    <updated>2012-04-14T07:33:35Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.437-comment:1264</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.437" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/mock-objects-despoil-your-tests.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/mock-objects-despoil-your-tests.html#comment-1264" />
    <title>Re: Mock Objects Despoil Your Tests — From: dagolden.com</title>
    <author>
        <name>dagolden.com</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>I'm not sure what your point is.  Maybe one or more of:</p>

<ul>
<li>Mock <em>objects</em> aren't a good testing technique</li>
<li><em>Mocking</em> isn't a good testing technique</li>
<li><em>Excessive</em> mocking gives false confidence in correct behavior</li>
<li>Something else?</li>
</ul>

<p>I don't see a big distinction between mock objects, monkey-patching, test databases, etc.  They are all techniques to simulate parts of a system, usually externalities.</p>

<p><strong>Testing itself is simulation.</strong>  The art of testing is finding the right abstractions to simulate behavior to confirm correctness to the right level of confidence (where the definition of "right" in each case will be different for different code, developers, companies, whatever.)</p>

<p>Is a test database (a "mock database") any better or worse than a mock object that simulates a database connection?  That depends.  For me, I'd say it's probably whichever is faster to implement; whichever is more likely to faithfully replicate behavior found in the real world; whether I'm trying to test requests or responses; and on what assumptions are acceptable about the correctness of the database itself.</p>

<p>That logic extends to other parts of your argument -- they all depend on the definition of "troublesome" for the nature of a particular test, but your definition of "troublesome" might differ from anothers'.  Maybe your argument reduces to <strong>"only mock what is troublesome and don't mock for the sake of mocking if that complexity is more troublesome than the trouble you're avoiding"</strong>.  I'd accept that, but still think the devil is in the details.</p>

<p>Your straw-man Socratic argument asks <em>"why test in isolation?"</em> and gives a facile answer.  A few more-thoughtful reasons I can think of off the top of my head include:</p>

<ul>
<li>It's often cheaper to test small bits of code (and/or data) than full systems, making it easier to test frequently during development, catching errors earlier when the cost to fix is lower</li>
<li>It's often easier to reason about correctness (for both test design and debugging) when there are fewer degrees of freedom, less coupling and less overall complexity</li>
<li>It's easier to write (and run) unit tests during development when only a portion of the system has been built or when development responsibilities are split across teams or developers</li>
</ul>

<p><strong>tl;dr summary:<strong></strong></strong></p>

<p>Excessive reliance on either unit testing or full-system testing is misguided.  Mocking is one of many techniques to construct a test simulation.  For any situation, pick a simulation technique to give the greatest confidence in correct behavior for the least amount of trouble.  Actually think what those mean to you and don't get stuck following anyone else's dogma.</p>]]>
    </content>
    <published>2012-04-14T01:27:45Z</published>
    <updated>2012-04-14T01:27:45Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.431-comment:1263</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.431" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/what-testing-dsls-get-wrong.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/what-testing-dsls-get-wrong.html#comment-1263" />
    <title>Re: What Testing DSLs Get Wrong — From: Shlomi Fish</title>
    <author>
        <name>Shlomi Fish</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>
Yes, I agree. Seems like in an attempt to try to make it suitable for non-programmers, cucumber complicates the syntax and its parsing and becomes much more error-prone. So I'm not a fan of it either. That put aside Ruby’s rSpec, on which I believe cucumber is based, is not as bad as cucumber syntax-wise, and also claims to fall under the Behaviour-Driven Development (BDD) umbrella.
</p>

<p>
In addition to all that, I've heard different views of how BDD differs from traditional Test-Driven-Development (TDD). Someone once said that there isn't a real difference, and someone on IRC told me that from what they understood, TDD was more about unit-tests, while BDD was more about integration tests and system tests. Personally, I have used Test::More and related modules to write some system tests and integration tests for my modules, and I don't see why they are not suitable for that (though I admit something like FIT or INGY's Test::Base may be somewhat better suitable if you're doing a lot of data-driven testing). Part of this may be an issue I have, that when I write a test, I usually don't consciously think whether it is a unit test or a system test or whatever, but just try to write a meaningful test that reproduces and tests the offending behaviour.
</p>]]>
    </content>
    <published>2012-04-12T18:04:30Z</published>
    <updated>2012-04-12T18:04:30Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.436-comment:1262</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.436-comment:1261" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/use-ok-is-broken-because-require-is-broken.html#comment-1261"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/use-ok-is-broken-because-require-is-broken.html#comment-1262" />
    <title>Re: use_ok() is Broken Because require() is Broken — From: chromatic</title>
    <author>
        <name>chromatic</name>
        <uri>http://www.wgz.org/~chromatic</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.wgz.org/~chromatic">
        <![CDATA[<p>use_ok( $module_name ) is in some ways prettier than eval "use $module_name", and it gives diagnostics on success. Beyond that, there's little else.</p>]]>
    </content>
    <published>2012-04-12T17:00:05Z</published>
    <updated>2012-04-12T17:00:05Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.436-comment:1261</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.436-comment:1257" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/use-ok-is-broken-because-require-is-broken.html#comment-1257"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/use-ok-is-broken-because-require-is-broken.html#comment-1261" />
    <title>Re: use_ok() is Broken Because require() is Broken — From: Aristotle Pagaltzis</title>
    <author>
        <name>Aristotle Pagaltzis</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>leto:</p>

<blockquote><p>It is quite useful for that.</p></blockquote>

<p>Really? What does it achieve that a “use” wouldn’t?</p>]]>
    </content>
    <published>2012-04-12T05:06:02Z</published>
    <updated>2012-04-12T05:06:02Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.434-comment:1260</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.434" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/defending-against-its-dynamic-scope.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/defending-against-its-dynamic-scope.html#comment-1260" />
    <title>Re: Defending Against Its Dynamic Scope — From: runrig.myopenid.com</title>
    <author>
        <name>runrig.myopenid.com</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>...according to the docs, <a href="http://code.google.com/p/corpus-tools/issues/list">an alternative tracker</a> is preferred to RT, so I suppose on the next update, the meta data could be added to tell <a href="http://search.cpan.org/dist/Lingua-Sentence/">search.cpan.org</a> where the preferred tracker is.</p>]]>
    </content>
    <published>2012-04-12T00:24:11Z</published>
    <updated>2012-04-12T00:24:11Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.434-comment:1259</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.434" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/defending-against-its-dynamic-scope.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/defending-against-its-dynamic-scope.html#comment-1259" />
    <title>Re: Defending Against Its Dynamic Scope — From: runrig.myopenid.com</title>
    <author>
        <name>runrig.myopenid.com</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>So, has a <a href="https://rt.cpan.org/Public/Dist/Display.html?Name=Lingua-Sentence">ticket</a> been filed, or the author notified yet?</p>]]>
    </content>
    <published>2012-04-12T00:18:37Z</published>
    <updated>2012-04-12T00:18:37Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.436-comment:1258</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.436-comment:1256" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/use-ok-is-broken-because-require-is-broken.html#comment-1256"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/use-ok-is-broken-because-require-is-broken.html#comment-1258" />
    <title>Re: use_ok() is Broken Because require() is Broken — From: chromatic</title>
    <author>
        <name>chromatic</name>
        <uri>http://www.wgz.org/~chromatic</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.wgz.org/~chromatic">
        <![CDATA[<p>I see this most in conjunction with use_ok, because it's compilation errors introduced while developing that cause the most weird failures.</p>]]>
    </content>
    <published>2012-04-11T18:26:57Z</published>
    <updated>2012-04-11T18:26:57Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.436-comment:1257</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.436" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/use-ok-is-broken-because-require-is-broken.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/use-ok-is-broken-because-require-is-broken.html#comment-1257" />
    <title>Re: use_ok() is Broken Because require() is Broken — From: leto.net</title>
    <author>
        <name>leto.net</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>I use 'use_ok' in a test file such as t/000_sanity.t to tell me if all my XS-based modules can be found and loaded correctly in Math::GSL. It is quite useful for that.</p>

<p>I agree with Schwern, 'use_ok' is not the problem.</p>]]>
    </content>
    <published>2012-04-11T18:22:12Z</published>
    <updated>2012-04-11T18:22:12Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.436-comment:1256</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.436" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/use-ok-is-broken-because-require-is-broken.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/use-ok-is-broken-because-require-is-broken.html#comment-1256" />
    <title>Re: use_ok() is Broken Because require() is Broken — From: schwern.myopenid.com</title>
    <author>
        <name>schwern.myopenid.com</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>While I agree that a require failure leaving things in a weird state is bad... the connection to `use_ok` is a stretch.  The "early failures make later failures suspect" is a known trade off in Perl testing.  You'd be better off rewriting the article just to talk about the `require` problem without the `use_ok` distraction.</p>]]>
    </content>
    <published>2012-04-11T18:16:26Z</published>
    <updated>2012-04-11T18:16:26Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.434-comment:1255</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.434-comment:1252" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/defending-against-its-dynamic-scope.html#comment-1252"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/defending-against-its-dynamic-scope.html#comment-1255" />
    <title>Re: Defending Against Its Dynamic Scope — From: chromatic</title>
    <author>
        <name>chromatic</name>
        <uri>http://www.wgz.org/~chromatic</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.wgz.org/~chromatic">
        <![CDATA[<p>Want something weirder? Interpolate $_ into its own string as the hash key and the clobbering still happens.</p>]]>
    </content>
    <published>2012-04-11T16:55:16Z</published>
    <updated>2012-04-11T16:55:16Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.434-comment:1254</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.434-comment:1252" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/defending-against-its-dynamic-scope.html#comment-1252"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/defending-against-its-dynamic-scope.html#comment-1254" />
    <title>Re: Defending Against Its Dynamic Scope — From: thirty5penguins.myopenid.com</title>
    <author>
        <name>thirty5penguins.myopenid.com</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>(actually in the map example I suppose it is the implicit return that fetches the value)</p>]]>
    </content>
    <published>2012-04-11T13:12:02Z</published>
    <updated>2012-04-11T13:12:02Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.434-comment:1253</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.434-comment:1252" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/defending-against-its-dynamic-scope.html#comment-1252"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/defending-against-its-dynamic-scope.html#comment-1253" />
    <title>Re: Defending Against Its Dynamic Scope — From: theclapp.myopenid.com</title>
    <author>
        <name>theclapp.myopenid.com</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>thirty5penguins: Indeed, some experimentation shows you've got it exactly right.  Thanks for the explanation, it all makes much more sense now.</p>]]>
    </content>
    <published>2012-04-11T13:10:09Z</published>
    <updated>2012-04-11T13:10:09Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.434-comment:1252</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.434-comment:1251" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/defending-against-its-dynamic-scope.html#comment-1251"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/defending-against-its-dynamic-scope.html#comment-1252" />
    <title>Re: Defending Against Its Dynamic Scope — From: thirty5penguins.myopenid.com</title>
    <author>
        <name>thirty5penguins.myopenid.com</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>In your example I think you'll find that the fetches are happening from within the join function rather than right before it. The function will get the variable not the value of the variable (but it will get the result of those f(), n() functions first).</p>

<p>In a simple map such as... map { $_, f($_) } ... it is less obvious but is the same situation: the actual map block is returning a list containing $_ (rather than the value of $_), and whatever happens after that is fetching the value.<br />
</p>]]>
    </content>
    <published>2012-04-11T12:17:58Z</published>
    <updated>2012-04-11T12:17:58Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.434-comment:1251</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.434" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/defending-against-its-dynamic-scope.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/defending-against-its-dynamic-scope.html#comment-1251" />
    <title>Re: Defending Against Its Dynamic Scope — From: theclapp.myopenid.com</title>
    <author>
        <name>theclapp.myopenid.com</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>... Or was that something that everyone but me already knew?  :)</p>]]>
    </content>
    <published>2012-04-10T20:30:07Z</published>
    <updated>2012-04-10T20:30:07Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.434-comment:1250</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.434" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/defending-against-its-dynamic-scope.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/defending-against-its-dynamic-scope.html#comment-1250" />
    <title>Re: Defending Against Its Dynamic Scope — From: theclapp.myopenid.com</title>
    <author>
        <name>theclapp.myopenid.com</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>That's pretty weird.  Given that => is just a synonym for the , operator, and the comma operator "[i]n list context, [is] just the list argument separator, and inserts both its arguments into the list.  These arguments are also evaluated from left to right", I'd expect the $_ => ... to be evaluated before the $entry->$_()</p>

<p>But it's not, and very strangely so: </p>

<p>perl -MModern::Perl -e 'sub f { say "_ is $_"; $_++ }; $_ = 0; say join( ", ", $_, f(), $_, f(), $_, f(), $_, f() );'<br />
_ is 0<br />
_ is 1<br />
_ is 2<br />
_ is 3<br />
4, 0, 4, 1, 4, 2, 4, 3</p>

<p>It works the same whether you use $_ or $x: the variable is evaluated at the end of the expression.</p>

<p>Using tie to see what runs when is illustrative:</p>

<p>perl -MModern::Perl -e 'package Tied; my $x = 0; sub TIESCALAR { bless {}, "Tied" } sub FETCH { say "FETCH $x"; $x } sub STORE { my ($this, $value) = @_; $x = $value; } package main; my $y; tie $y, "Tied"; sub f { say "y is $y"; $y = $y + 1; }; sub n { print "\n"; () } $y = 0; say join( ", ", $y, f(), n(), $y, f(), n(), $y, f(), n(), $y, f(), n() );'<br />
FETCH 0<br />
y is 0<br />
FETCH 0<br />
FETCH 1</p>

<p>FETCH 1<br />
y is 1<br />
FETCH 1<br />
FETCH 2</p>

<p>FETCH 2<br />
y is 2<br />
FETCH 2<br />
FETCH 3</p>

<p>FETCH 3<br />
y is 3<br />
FETCH 3<br />
FETCH 4</p>

<p>FETCH 4<br />
FETCH 4<br />
FETCH 4<br />
FETCH 4<br />
4, 1, 4, 2, 4, 3, 4, 4</p>

<p>As we can see, the value of $y is fetched four times, right before running join, not interleaved with the calls to f().</p>]]>
    </content>
    <published>2012-04-10T19:54:23Z</published>
    <updated>2012-04-10T19:54:23Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.434-comment:1249</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.434" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/defending-against-its-dynamic-scope.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/defending-against-its-dynamic-scope.html#comment-1249" />
    <title>Re: Defending Against Its Dynamic Scope — From: thirty5penguins.myopenid.com</title>
    <author>
        <name>thirty5penguins.myopenid.com</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>I could tell from reading your post that you know exactly where $_ is being globbered :) You're very diplomatic; I like it!<br />
</p>]]>
    </content>
    <published>2012-04-10T13:46:18Z</published>
    <updated>2012-04-10T13:46:18Z</updated>

</entry>

<entry>

    <id>tag:www.modernperlbooks.com,2012:/mt//1.433-comment:1248</id>

    <thr:in-reply-to ref="tag:www.modernperlbooks.com,2012:/mt//1.433" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/perl-and-that-dirty-word.html"/>


    <link rel="alternate" type="text/html" href="http://www.modernperlbooks.com/mt/2012/04/perl-and-that-dirty-word.html#comment-1248" />
    <title>Re: Perl and that Dirty Word — From: https://me.yahoo.com/nbezzala#a0aed</title>
    <author>
        <name>https://me.yahoo.com/nbezzala#a0aed</name>
        
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>I believe that the next step in marketing Perl, and a good direction for Perl to take would be this-</p>

<p>Perl makes easy things "very easy" and difficult things possible.<br />
or even<br />
Perl makes difficult things easy and easy things easier.</p>

<p><br />
Perl makes it very easy to write a simple Hello World script, and learn the basics. But if I want to create a web page, PHP makes it easier.</p>

<p>Maybe we should make it possible to install Wamp, and run this.</p>

<p>&lt;?perl<br />
&nbsp;&nbsp;&nbsp;&nbsp;    say "Hello World";<br />
?&gt;<br />
</p>]]>
    </content>
    <published>2012-04-10T04:07:39Z</published>
    <updated>2012-04-10T04:07:39Z</updated>

</entry>

</feed>
