<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/atom10full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom"><title>Perl Tips</title><subtitle>From Perl Training Australia</subtitle><logo>http://perltraining.com.au/images/logo.png</logo><link href="http://perltraining.com.au/tips/" /><id>http://perltraining.com.au/tips/</id><author><name>Perl Training Australia</name></author><updated>2008-10-15T00:00:00Z</updated><generator uri="http://search.cpan.org/dist/XML-Atom-SimpleFeed" version="0.8">XML::Atom::SimpleFeed</generator><link rel="self" href="http://perltraining.com.au/tips/index.atom" type="application/atom+xml" /><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Fperltraining.com.au%2Ftips%2Findex.atom" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Fperltraining.com.au%2Ftips%2Findex.atom" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Fperltraining.com.au%2Ftips%2Findex.atom" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.bloglines.com/sub/http://perltraining.com.au/tips/index.atom" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Fperltraining.com.au%2Ftips%2Findex.atom" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://fusion.google.com/add?feedurl=http%3A%2F%2Fperltraining.com.au%2Ftips%2Findex.atom" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Fperltraining.com.au%2Ftips%2Findex.atom" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><entry><title> Starting a module with Module::Starter </title><link href="http://perltraining.com.au/tips/2008-10-15.html" /><id>http://perltraining.com.au/tips/2008-10-15.html</id><updated>2008-10-15T00:00:00Z</updated><content type="html">
&lt;p&gt;Starting a new module can be a lot of work.  A good module should have
a build system, documentation, a test suite, and numerous other bits
and pieces to assist in its easy packaging and development.  These are
useful even if we never release our module to CPAN.&lt;/p&gt;
&lt;p&gt;Setting this up can be a lot of work, especially if you've never done
it before.  While the &lt;code&gt;h2xs&lt;/code&gt; tool that comes with Perl will do some
of this for you, it's showing its age, and doesn't allow us to take
advantage of recent tools.  We want to spend our time writing code,
not trying to decode our build system.&lt;/p&gt;
&lt;p&gt;That's where &lt;code&gt;Module::Starter&lt;/code&gt; comes in handy.  It provides
a simple, command-line tool to create a skeleton module quickly and
easily.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;a href="http://perltraining.com.au/tips/2008-10-15.html"&gt;Read more...&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=2nHrM"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=2nHrM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=3yZkm"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=3yZkm" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=qve4m"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=qve4m" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=ZSWIM"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=ZSWIM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=r3U8m"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=r3U8m" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content></entry><entry><title> autodie - The art of Klingon Programming </title><link href="http://perltraining.com.au/tips/2008-08-20.html" /><id>http://perltraining.com.au/tips/2008-08-20.html</id><updated>2008-08-20T00:00:00Z</updated><content type="html">
&lt;pre&gt;
   bIlujDI' yIchegh()Qo'; yIHegh()!

   It is better to die() than to return() in failure.

       -- Klingon programming proverb.
&lt;/pre&gt;
&lt;h2&gt;The problem with error handling&lt;/h2&gt;
&lt;p&gt;One of the first things most people learn when programming
in Perl is to always check to see if system calls like &lt;code&gt;open&lt;/code&gt;
are successful.  The most common construct seen for such
checking is the &lt;em&gt;do or die&lt;/em&gt; style:&lt;/p&gt;
&lt;pre&gt;
    open(my $fh, '&amp;lt;', $filename) or die &amp;quot;Can't open $filename - $!&amp;quot;;&lt;/pre&gt;
&lt;p&gt;The problem with &lt;em&gt;do or die&lt;/em&gt; is that for calls to built-ins
like &lt;code&gt;open&lt;/code&gt;, it's very rare that we'd want to do anything &lt;em&gt;other&lt;/em&gt;
than die on failure.  Even if we wish to handle the error, the
call to &lt;code&gt;die&lt;/code&gt; provides a convenient way to generate an exception,
which we can then trap using an &lt;code&gt;eval&lt;/code&gt; block.&lt;/p&gt;
&lt;p&gt;Unfortunately, the &lt;em&gt;do or die&lt;/em&gt; construct is tiresome to repeat,
easily forgotten, and in many cases takes up more code and visual
space than the function it is designed to guard.&lt;/p&gt;
&lt;p&gt;Wouldn't it be nice if functions could die automatically on failure?&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;a href="http://perltraining.com.au/tips/2008-08-20.html"&gt;Read more...&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=2rNKZK"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=2rNKZK" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=kFWhCk"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=kFWhCk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=3ZJ8Gk"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=3ZJ8Gk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=xHgthK"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=xHgthK" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=7NTUhk"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=7NTUhk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content></entry><entry><title> Improving regular expressions </title><link href="http://perltraining.com.au/tips/2008-06-06.html" /><id>http://perltraining.com.au/tips/2008-06-06.html</id><updated>2008-06-06T00:00:00Z</updated><content type="html">
&lt;p&gt;Many programmers find regular expressions to be esoteric constructions.  They're dense, complex, and for many people utterly incomprehensible.  Large regular expressions without sufficient documentation can be staggeringly difficult to maintain, so it's no surprise that many developers are happy if they match at all, even if they're not as fast or maintainable as they could be.&lt;/p&gt;
&lt;p&gt;This tip will focus on how to make regular expressions easier to understand, easier to maintain, and faster to run.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;a href="http://perltraining.com.au/tips/2008-06-06.html"&gt;Read more...&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=unFVII"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=unFVII" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=PyvcKi"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=PyvcKi" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=0f4Mpi"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=0f4Mpi" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=nROKpI"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=nROKpI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=4q6jii"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=4q6jii" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content></entry><entry><title> Building executables with PAR </title><link href="http://perltraining.com.au/tips/2008-05-23.html" /><id>http://perltraining.com.au/tips/2008-05-23.html</id><updated>2008-05-23T00:00:00Z</updated><content type="html">
&lt;p&gt;One of Perl's greatest strengths is the huge number of modules available on 
the CPAN.  Many really tricky problems can be made quite simple with just 
the use of a few appropriate modules.&lt;/p&gt;
&lt;p&gt;Unfortunately, using CPAN modules results in another problem.  Using modules 
makes development easier, but it makes installing code much more difficult.
Not only do we have to ensure that the modules we use are installed, but we 
also need to ensure they modules they depend upon also get installed.  Worst 
of all, we may be writing code for machines that don't even have Perl 
installed at all, or a version so old that none of our modules work on it.&lt;/p&gt;
&lt;p&gt;If this seems familiar, then PAR, the Perl Archiver, may provide relief from 
your installation woes.  PAR allows you to bundle all of your modules, 
configuration files, and other dependencies into a single compressed 
archive, and then distribute that along with, or instead of, your code.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;a href="http://perltraining.com.au/tips/2008-05-23.html"&gt;Read more...&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=D0rp3H"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=D0rp3H" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=TQgeTh"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=TQgeTh" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=edpwFh"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=edpwFh" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=UDUvwH"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=UDUvwH" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=SEW2dh"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=SEW2dh" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content></entry><entry><title> Smart-match </title><link href="http://perltraining.com.au/tips/2008-04-18.html" /><id>http://perltraining.com.au/tips/2008-04-18.html</id><updated>2008-04-18T00:00:00Z</updated><content type="html">
&lt;p&gt;Perl 5.10 introduces a new-operator, called &lt;em&gt;smart-match&lt;/em&gt;, written
&lt;code&gt;~~&lt;/code&gt;.  As the name suggests, &lt;em&gt;smart-match&lt;/em&gt; tries to compare its
arguments in an intelligent fashion.  Using &lt;em&gt;smart-match&lt;/em&gt; effectively
allows many complex operations to be reduces to very simple statements.&lt;/p&gt;
&lt;p&gt;Unlike many of the other features introduced in Perl 5.10, there's
no need to use the &lt;code&gt;feature&lt;/code&gt; pragma to enable &lt;em&gt;smart-match&lt;/em&gt;,
as long as you're using 5.10 it's available.&lt;/p&gt;
&lt;p&gt;The smart-match operator is always commutative.  That means that
&lt;code&gt;$x ~~ $y&lt;/code&gt; works the same way as &lt;code&gt;$y ~~ $x&lt;/code&gt;.  You'll never have to
remember which order to place to your operands with smart-match.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;a href="http://perltraining.com.au/tips/2008-04-18.html"&gt;Read more...&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=wfRo9H"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=wfRo9H" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=6f2wgh"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=6f2wgh" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=HEGavh"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=HEGavh" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=rwKTXH"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=rwKTXH" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/PerlTips?a=0HG0zh"&gt;&lt;img src="http://feeds.feedburner.com/~f/PerlTips?i=0HG0zh" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content></entry></feed>
