Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / 2012_04.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
4 <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6    <meta name="generator" content="Movable Type 5.2.3" />
7
8    <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles-site.css" type="text/css" />
9    <link rel="alternate" type="application/atom+xml" title="Atom" href="http://defaria.com/blogs/Status/atom.xml" />
10    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://defaria.com/blogs/Status/index.xml"$>" />
11
12    <title>Status for Andrew DeFaria: April 2012 Archives</title>
13
14    <link rel="start" href="http://defaria.com/blogs/Status/" title="Home" />
15    <link rel="prev" href="http://defaria.com/blogs/Status/archives/2012_02.html" title="February 2012" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/2012_05.html" title="May 2012" />
17 </head>
18 <body class="layout-one-column">
19    <div id="container">
20       <div id="container-inner" class="pkg">
21
22          <div id="banner">
23             <div id="banner-inner" class="pkg">
24                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
25                <h2 id="banner-description">Searchable status reports and work log</h2>
26             </div>
27          </div>
28
29          <div id="pagebody">
30             <div id="pagebody-inner" class="pkg">
31                <div id="alpha">
32                   <div id="alpha-inner" class="pkg">
33                      
34                      <p class="content-nav">
35                         <a href="http://defaria.com/blogs/Status/archives/2012_02.html">&laquo; February 2012</a> |
36                         <a href="http://defaria.com/blogs/Status/">Main</a>
37                         | <a href="http://defaria.com/blogs/Status/archives/2012_05.html">May 2012 &raquo;</a>
38                      </p>
39                      
40                      
41                      <!--
42 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
43          xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
44          xmlns:dc="http://purl.org/dc/elements/1.1/">
45 <rdf:Description
46     rdf:about="http://defaria.com/blogs/Status/archives/2012_04.html#entry-000751"
47     trackback:ping="http://defaria.com/mt/mt-tb.cgi/115"
48     dc:title="Perl::Critic"
49     dc:identifier="http://defaria.com/blogs/Status/archives/2012_04.html#entry-000751"
50     dc:subject="Broadcom"
51     dc:description="OK, I&apos;m a nerd and I&apos;m pretty passionate about Perl. But in my defense this is my business and my chosen career - it is what I went to school for way back in the day. So I listen to..."
52     dc:creator=""
53     dc:date="2012-04-11T13:38:27-06:00" />
54 </rdf:RDF>
55 -->
56
57
58                      <h2 class="date-header">April 11, 2012</h2>
59                      <a id="a000751"></a>
60                      <div class="entry" id="entry-751">
61                         <h3 class="entry-header">Perl::Critic</h3>
62                         <div class="entry-content">
63                            <div class="entry-body">
64                               <p>OK, I'm a nerd and I'm pretty passionate about Perl. But in my defense this is my business and my chosen career - it is what I went to school for way back in the day. So I listen to podcasts about many topics including technology. One podcast I listen to regularly is <a href="http://twit.tv/show/floss-weekly">FLOSS Weekly</a> with <a href="https://en.wikipedia.org/wiki/Randal_Schwartz">Randal Schwartz</a>. Randal wrote <a href="http://www.amazon.com/Learning-Perl-Randal-L-Schwartz/dp/1449303587">Learning Perl</a> among other Perl books and he had on <a href="http://search.cpan.org/~thaljef/">Jeffery Thalhammer</a> who talked about his creation <a href="http://www.perlcritic.org/">Perl::Critic</a>. For those who may be interested the Perl::Critic episode is <a href="http://twit.tv/show/floss-weekly/189">here</a>.</p>
65
66 <p>The easiest way you can try out Perl::Critic by going to <a href="http://www.perlcritic.org/">http://www.perlcritic.org/</a>. You can even evaluate your own Perl scripts by using the Choose File and set your severity level. You can start with gentle but I usually do harsh as that's in the middle.</p>
67
68 <p>Perl::Critic is a static analyzer that finds inconsistencies and possible errors in your Perl code as well as tries to enforce best practices as written about in <a href="http://shop.oreilly.com/product/9780596001735.do">Perl Best Practices</a> by Damian Conway. Perl::Critic is implemented as a CPAN module. There is also a command line (<a href="http://search.cpan.org/%7Eschwigon/Benchmark-Perl-Formance-Cargo-0.03/lib/auto/Benchmark/Perl/Formance/Cargo/PerlCritic/perlcritic">/usr/bin/perlcritic</a>) that allows you to run perlcritic on your code from the command line. But the web page is better because it provides links to explanations of why Perl::Critic thinks what it complains about is a problem as well as tells you how to fix it.</p>
69
70 <p>Now, of course, critiquing your code is highly subjective and you may not agree with the rational for why Perl::Critic flags this as a problem. Perl::Critic is very tunable - you can set settings in ~/.perlcriticrc to say "We don't want you, Perl::Critic, to flag this as a problem".</p>
71
72 <p>If you use <a href="https://eclipse.org/">Eclipse</a> as your IDE and have <a href="http://www.epic-ide.org/">EPIC, the Eclipse Perl Integration plugin</a>, and have <a href="http://cygwin.com/">Cygwin</a> installed with <a href="http://search.cpan.org/%7Eschwigon/Benchmark-Perl-Formance-Cargo-0.03/lib/auto/Benchmark/Perl/Formance/Cargo/PerlCritic/perlcritic">perlcritic</a> installed too, you can configure Eclipse to use Perl::Critic directly in the editor and flag errors as you code which you can then fix.</p>
73
74 <p>For example, you can see the little triangle with "!" in it relates to the line in the Problems tab at the bottom which says that I've defined $value but never used it.</p>
75
76 <img src="/blogs/Status/images/Eclipse.png">
77                               
78                               <p class="entry-footer">
79                                  <span class="post-footers">Posted by  at  1:38 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000751.html">Permalink</a>
80                                  
81                                  | <a href="http://defaria.com/blogs/Status/archives/000751.html#trackback">TrackBacks (0)</a>
82                               </p>
83                            </div>
84                         </div>
85                      </div>
86                      
87                   </div>
88                </div>
89             </div>
90          </div>
91       </div>
92    </div>
93 </body>
94 </html>