Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / 000751.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: Perl::Critic</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/000750.html" title="Using PDSQL to update Clearquest databases" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/000752.html" title="2012-05-11-adefaria" />
17
18    <!--
19 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
20          xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
21          xmlns:dc="http://purl.org/dc/elements/1.1/">
22 <rdf:Description
23     rdf:about="http://defaria.com/blogs/Status/archives/000751.html"
24     trackback:ping="http://defaria.com/mt/mt-tb.cgi/115"
25     dc:title="Perl::Critic"
26     dc:identifier="http://defaria.com/blogs/Status/archives/000751.html"
27     dc:subject="Broadcom"
28     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..."
29     dc:creator=""
30     dc:date="2012-04-11T13:38:27-06:00" />
31 </rdf:RDF>
32 -->
33
34
35    
36
37    <script type="text/javascript" src="http://defaria.com/blogs/Status/mt-site.js"></script>
38 </head>
39 <body class="layout-one-column" onload="individualArchivesOnLoad(commenter_name)">
40    <div id="container">
41       <div id="container-inner" class="pkg">
42
43          <div id="banner">
44             <div id="banner-inner" class="pkg">
45                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
46                <h2 id="banner-description">Searchable status reports and work log</h2>
47             </div>
48          </div>
49
50          <div id="pagebody">
51             <div id="pagebody-inner" class="pkg">
52                <div id="alpha">
53                   <div id="alpha-inner" class="pkg">
54
55                      <p class="content-nav">
56                         <a href="http://defaria.com/blogs/Status/archives/000750.html">&laquo; Using PDSQL to update Clearquest databases</a> |
57                         <a href="http://defaria.com/blogs/Status/">Main</a>
58                         | <a href="http://defaria.com/blogs/Status/archives/000752.html">2012-05-11-adefaria &raquo;</a>
59                      </p>
60
61                      <a id="a000751"></a>
62                      <div class="entry" id="entry-751">
63                         <h3 class="entry-header">Perl::Critic</h3>
64                         <div class="entry-content">
65                            <div class="entry-body">
66                               <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>
67
68 <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>
69
70 <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>
71
72 <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>
73
74 <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>
75
76 <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>
77
78 <img src="/blogs/Status/images/Eclipse.png">
79                            </div>
80                            <div id="more" class="entry-more">
81                               
82                            </div>
83                         </div>
84                         <p class="entry-footer">
85                            <span class="post-footers">Posted by  on April 11, 2012  1:38 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000751.html">Permalink</a>
86                         </p>
87                      </div>
88
89                      
90                      <div class="trackbacks">
91                         <h3 id="trackback" class="trackbacks-header">TrackBack</h3>
92                         <div id="trackbacks-info">
93                            <p>TrackBack URL for this entry:<br />http://defaria.com/mt/mt-tb.cgi/115</p>
94                         </div>
95                         <div class="trackbacks-content">
96                            
97                         </div>
98                      </div>
99                      
100
101                      
102                   </div>
103                </div>
104             </div>
105          </div>
106       </div>
107    </div>
108 </body>
109 </html>