<?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>sirhc.us maxim.us &#187; Perl</title>
	<atom:link href="http://sirhc.us/tag/perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://sirhc.us</link>
	<description>the pathological prattle of a primal perl programmer</description>
	<lastBuildDate>Fri, 06 Jan 2012 05:04:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Repeated Capturing and Parsing in Perl</title>
		<link>http://sirhc.us/repeated-capturing-and-parsing-in-perl/</link>
		<comments>http://sirhc.us/repeated-capturing-and-parsing-in-perl/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 05:04:10 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[capturing]]></category>
		<category><![CDATA[grammars]]></category>
		<category><![CDATA[Parse::RecDescent]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[Regexp::Grammars]]></category>
		<category><![CDATA[regular expressions]]></category>

		<guid isPermaLink="false">http://sirhc.us/?p=859</guid>
		<description><![CDATA[When I checked my email after arriving at the office today, I found a query that had been sent to our internal Perl mail list. The questioner was trying to match a pattern repeatedly, capturing all of the results in &#8230; <a href="http://sirhc.us/repeated-capturing-and-parsing-in-perl/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When I checked my email after arriving at the office today, I found a query that had been sent to our internal Perl mail list.  The questioner was trying to match a pattern repeatedly, capturing all of the results in an array.  But, it wasn&#8217;t doing quite what he expected.  The message, with minor edits, went a little something like the following.</p>
<blockquote><p>
I&#8217;m trying to extract key/value pairs from a file with the following contents:</p>
<pre>- name = gcc_xo_src_clk, type = rcg
+ name = cxo_clk, type = xo, fgroup = xo, wt = 10, bloo = blah
? type = hm_mnd_rcg, name = bo : type = rcg_mn
+ name = pxo_clk</pre>
<p>I was hoping to do something like this:</p>
<pre>@list = $_ =~ m{ ^[-+?] \s* (\S+) \s* = \s* (\S+) \s* (?:, \s* (\S+) \s* = \s* (\S+) \s*)* }xms;</pre>
<p>Thinking @list would be assigned the alternating key/value pairs.  But the above doesn&#8217;t extract anything sane.  Adding the /gc modifiers doesn&#8217;t make any difference.</p>
<p>If I do the following, it extracts the first two key/value pairs correctly (if the line has more than one pair).</p>
<pre>@list = $_ =~ m{
    ^[-+?] \s* (\S+) \s* = \s* (\S+) \s*
    , \s* (\S+) \s* = \s* (\S+) \s*
}xms;</pre>
<p>If I keep repeating the pattern in the second line, it keeps matching more key/value pairs.</p>
<p>I would expect using (?: )* should mean zero or more instances of match inside the parentheses, but obviously it&#8217;s not working.  What am I doing wrong?
</p></blockquote>
<p>When I&#8217;m presented with a problem like this, that is some kind of structured data, I immediately think of writing a parser.  I&#8217;ll get back to that in a bit, but I wanted to address the confusion about capturing in the pattern.  And, in fact, that&#8217;s how the discussion on the mail list proceeded.</p>
<h2>Repeated Capturing</h2>
<p>First, let&#8217;s simplify the example to demonstrate why our seeker of wisdom isn&#8217;t getting back the list of items he expected.</p>
<pre>my @matches = 'a b c d e' =~ /^(a) \s* (?: ([bcde]) \s* )*/xms;

say "(@matches)";   # prints "(a e)"</pre>
<p>Capturing parentheses in Perl are treated somewhat like registers.  Most Perl programmers are familiar with the <code>$<i>n</i></code> variables, which hold the values of a successful pattern match.  For example <code>$1</code> holds the value matched by the first set of parentheses, <code>$2</code> holds the value of the second set, and so on.</p>
<p>When a pattern is matched in list context, as above, it&#8217;s effectively the same as writing,</p>
<pre>'a b c d e' =~ /^(a) \s* (?: ([bcde]) \s* )*/xms;

my @matches = ( $1, $2 );</pre>
<p>These pattern match variables are scalars and, as such, will only hold a single value.  That value is whatever the capturing parentheses matched last.  So, in our simplified example, <code>$1</code> matches <code>a</code>, which is obvious enough.  As the pattern repeats, <code>$2</code> would be set to <code>b</code>, then <code>c</code>, and so on until the final match of <code>e</code>.</p>
<p>That explains why the pattern match wasn&#8217;t returning the expected list.  What can be done about it?</p>
<h2>Capturing Along the Way</h2>
<p>If we break down the sample data, we see that it generalizes to,</p>
<pre><i>prefix</i> <i>key</i> = <i>value</i>[, ...] [: <i>key</i> = <i>value</i>[, ...]]</pre>
<p>The first approach that came to mind is to split the data into multiple lines.  Each line can then have its initial <i>prefix</i> removed and saved, then parsed for its key/value pairs.  That&#8217;s starting to look a lot like parsing, which I promised to get to later.  For the purposes of this discussion, I wanted to be able to accomplish the task with a single regular expression.</p>
<p>To capture all of the values we want, we need to remove the repeating set of non-capturing parentheses.  However, we still need to repeat the match, ideally returning all of the captured values in one statement.  We can do that with the <code>/g</code> and <code>/c</code> regular expression modifiers.</p>
<pre>my @list = $string =~ m{ ([-+?,:]) \s* (\w+) \s* = \s* (\w+) \s* }xmsgc;</pre>
<p>I&#8217;ve done two things here.  First, I replaced the <code>\S</code> character classes, used to match the key and value, with <code>\w</code>.  The <code>+</code> pattern in a Perl regular expression is greedy, so the former character class was also matching the comma used to separate key/value pairs in the data.  This left the literal comma with nothing to match, so was one source of confusion.</p>
<p>Second, I noted that the initial <i>prefix</i>, while syntactically important, could be viewed in the same way as the comma and colon separators.  I combined all of these separators and added a capture around them so we can later make sense of the parsed data.</p>
<p>When matched against the data, the pattern results in a list like,</p>
<pre>("-", "name", "gcc_xo_src_clk", ",", "type", "rcg", "+", "name", "cxo_clk", ...)</pre>
<p>Now we can process the data using a simple state machine.</p>
<pre>my $state = undef;

while ( my $token = shift @list ) {
    if ( $token eq '-' ) { $state = 'dash'; next; }
    # ...
    if ( $token eq ',' ) { next; }

    my $key   = shift @list;
    my $value = shift @list;

    if ( $state eq 'dash' ) {
        # ...
    }
}</pre>
<p>Even though we did all of the data extraction using a single pattern match, it looks remarkably like &#8230; a parser!  The pattern is simply the tokenizer used to feed tokens into our state machine, the parser.</p>
<h2>Parsing</h2>
<p>I stated at the outset that I looked at this as a parsing problem, so the solution I would use is most likely a parser.  For simple, one-off scripts, I&#8217;d use a technique similar to the one I described in the previous section.  However, for more complex data or a more complex script, I&#8217;d turn to a real parser.</p>
<p>In fact, one of my contributions to the thread that led me to compose this post included an example of using the <code>$^R</code> and <code>$^N</code> variables in embedded code blocks to demonstrate a rudimentary parser that allowed a simulated form of capturing within a repeated non-capturing group.  I won&#8217;t go into any detail beyond showing what I wrote.  As this was from an early point in the thread, the <i>prefix</i> is ignored in this example.</p>
<pre>my @list = ();

my $kv = qr{
    (\w+) (?{ $^N; })           # capture the key
    \s* = \s* (\w+)
    (?{ $^R = [ $^R, $^N ]; })  # capture the value, saving the key
    (?{ push @list, @{ $^R } }) # push the key/value onto @list
}xms;

$data =~ m{ (?: ^[-+?] \s* $kv \s* (?:[,:] \s* $kv \s* )* )* }xms;</pre>
<p>Fortunately for us, there are parsing modules on the CPAN.</p>
<p>Prior to Perl 5.10, Damian Conway had written <a href="https://metacpan.org/module/Parse::RecDescent"><code>Parse::RecDescent</code></a>, but with the introduction of grammar-like facilities like named captures and named backreferences, Damian improved upon his original work and presented the Perl community with <a href="https://metacpan.org/module/Regexp::Grammars"><code>Regexp::Grammars</code></a>.</p>
<p>What does a parser for this data built with <code>Regexp::Grammars</code> look like?</p>
<pre>my $parser = qr{
    &lt;[Line]&gt;+

    &lt;token: Prefix&gt;   &lt;MATCH= ([-+?]) &gt;
    &lt;token: Key&gt;      &lt;MATCH= (\w+) &gt;
    &lt;token: Value&gt;    &lt;MATCH= (\w+) &gt;

    &lt;rule: Line&gt;      &lt;Prefix&gt; &lt;Pairs&gt; &lt;Options&gt;?
    &lt;rule: Pairs&gt;     &lt;[Pair]&gt;* % ,
    &lt;rule: Pair&gt;      &lt;Key&gt; = &lt;Value&gt;
    &lt;rule: Options&gt;   : &lt;[Option]&gt;* % ,
    &lt;rule: Option&gt;    &lt;Key&gt; = &lt;Value&gt;
}x;

if ( $data =~ $parser ) {
    # Do something with %/
}</pre>
<p>This is a trivial example and all the work is left to be done by inspecting the parse tree in <code>%/</code>.  However, the module supports embedded code that will be called when a token or rule matches, which can be used to process the data as its parsed.</p>
<h2>References</h2>
<ul>
<li><a href="http://perldoc.perl.org/perlre.html">perlre</a></li>
<li><a href="http://perldoc.perl.org/perlretut.html">perlretut</a></li>
<li><a href="http://perldoc.perl.org/perlvar.html">perlvar</a></li>
<li><a href="https://metacpan.org/module/Parse::RecDescent">Parse::RecDescent</a></li>
<li><a href="https://metacpan.org/module/Regexp::Grammars">Regexp::Grammars</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/repeated-capturing-and-parsing-in-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSCON 2011: Friday</title>
		<link>http://sirhc.us/oscon-2011-friday/</link>
		<comments>http://sirhc.us/oscon-2011-friday/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 00:46:00 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Travel]]></category>
		<category><![CDATA[Burgerville]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[grid]]></category>
		<category><![CDATA[milkshake]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon2011]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[shipwright]]></category>
		<category><![CDATA[sockgate]]></category>
		<category><![CDATA[Stargate]]></category>

		<guid isPermaLink="false">http://sirhc.us/?p=783</guid>
		<description><![CDATA[Friday marked the last day of the O&#8217;Reilly Open Source Convention (OSCON), and my last day in Portland, Oregon. Unlike previous trips, I traveled home on Friday night instead of Saturday morning. In the past, I&#8217;ve sat around my hotel &#8230; <a href="http://sirhc.us/oscon-2011-friday/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Friday marked the last day of the <a href="http://www.oscon.com/oscon2011/">O&#8217;Reilly Open Source Convention</a> (OSCON), and my last day in Portland, Oregon.  Unlike previous trips, I traveled home on Friday night instead of Saturday morning.  In the past, I&#8217;ve sat around my hotel on Friday night with nothing to do except finish posts about OSCON.  There is one drawback, though.  I&#8217;m finally finishing this post 20 days later, which means it probably won&#8217;t be as fleshed out as my posts about Wednesday and Thursday.</p>
<p>After my near complete lack of interest in the keynotes I saw on Wednesday and Thursday mornings, I paid little attention to those on Friday.  I thought the message Karen Sandler had about <a href="http://www.oscon.com/oscon2011/public/schedule/detail/21426">open health</a> was good, but that&#8217;s about all I can say about them.</p>
<p>By far I was the most pleased by the sessions I attended on Friday.  First, Kevin Falcone&#8217;s <a href="http://www.oscon.com/oscon2011/public/schedule/detail/19126">Shipwright: Application Distribution Simplified</a>.  Kevin works for Best Practical, a company with the <a href="http://www.flickr.com/photos/andyarmstrong/2402300165/">best shirts</a>.  I plan on doing some evangelizing of Shipwright at work, as it would help a lot of people, including me, to better develop and deploy their applications.</p>
<p>I wasn&#8217;t planning on attending OSCON this year.  I was perfectly happy skipping it and staying home during the last week of July.  Then I happened to be looking over the list of Perl sessions and saw, at the very end of the list, <a href="http://www.oscon.com/oscon2011/public/schedule/detail/18392">Easy Distributed Computing with Perl and Grid::Request</a>.  It seems that Victor Felix has released a module that does exactly the same thing as some of the modules I&#8217;ve maintained at work, only the design is much better.  However, it doesn&#8217;t support the batch system we use.  I emailed Victor to discuss some collaboration and registered for OSCON so I could meet him.  So yeah, I attended OSCON for one session.  But it was worth it.  The module looks great and Victor seems happy that I have an interest to contribute.  It will be much better use of my time to contribute to a module on the CPAN than to continue pouring effort into what we have today.</p>
<p>Since, after chatting for a bit with Victor, I was already standing outside the room well into the next time slot, I popped into <a href="http://www.oscon.com/oscon2011/public/schedule/detail/18768">Git for Ages 4 &amp; Up</a>.  Michael Schwern and Ricardo Signes demonstrated the Git commands everyone should know to get started with the version control system.  As an added bonus, they used <a href="http://en.wikipedia.org/wiki/Tinkertoy">tinkertoys</a> to help the audience visualize what Git&#8217;s internal representation of the repository looked like after each command.  It was definitely a different and entertaining talk.</p>
<p>Prior to the closing keynote, Piers Cawley was invited to sing his library song, which I mentioned in <a href="http://sirhc.us/oscon-2011-thursday/">Thursday&#8217;s post</a>, again for the benefit of all OSCON attendees.</p>
<p>Paul Fenwick delivered the closing keynote.  If you haven&#8217;t seen one of his talks, shame on you.  Here, to help you fix that, I&#8217;ll refer you to his keynote, <a href="http://www.youtube.com/watch?v=OnX5v0uwNjc&#038;list=PL93FC98105B19725C&#038;index=39">All Your Brains Suck&mdash;Known Bugs and Exploits in Wetware</a>.</p>
<p>After three days in Portland, I finally ate at <a href="http://burgerville.com/">Burgerville</a>.  Eating at this regional chain is something I look forward to every time I&#8217;m in the area.  Though, I suppose my <a href="http://sirhc.us/before-after-why-i-care-about-my-health/">change in diet</a> may have suppressed my eagerness and led me to put it off until Friday.  In any case, I ordered a cheeseburger with grilled onions (ditching the bun) and a large raspberry shake.  While I prefer their blackberry shakes when available, the meal was delicious.</p>
<p>The high point of the conference happened, oddly enough, after it had ended.  For whatever reason, I happened to wander into a different area of the convention center, in which a sock knitting conference was taking place.  Outside of their expo hall was the Sockgate, a cardboard replica of a <a href="http://stargate.wikia.com/wiki/Stargate">Stargate</a>.  As we were waiting to take pictures with it, Paul Fenwick happened by and offered to take some photos.  He&#8217;s a really nice guy and I enjoyed finally getting the chance to meet him.  After the photo op, he headed into the knitting expo hall.  In retrospect, I should have done the same.  It would have been interesting to see what it was like.</p>
<div class="wp-caption aligncenter" style="width: 410px"><img alt="Sockgate" src="https://lh5.googleusercontent.com/-yvtw-Izpfy8/Tk2pgc36rYI/AAAAAAAABoc/KQfY0iF_zl0/s400/286278_264778273538030_236078669741324_1274545_6827680_o.jpg" title="Traversing the Sockgate" width="400" height="267" /><p class="wp-caption-text">Photo Credit: Paul Fenwick</p></div>
<p>Finally, I learned that when I attend OSCON, I really do need to go for the entire week.  Apparently, it takes me about two days to acclimate myself to the environment and really start interacting with people.  Of course, by arriving Tuesday night, I was ready to interact on Friday, just as everyone was heading home.  It didn&#8217;t help that I was staying in a hotel way out by the airport, with MAX service ending before 11:00 PM.  With a new baby at home, I certainly don&#8217;t regret my choice to be away for a shorter period of time, but if I go next year, I&#8217;ll probably go for the entire week.</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2011-friday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSCON 2011: Thursday</title>
		<link>http://sirhc.us/oscon-2011-thursday/</link>
		<comments>http://sirhc.us/oscon-2011-thursday/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 23:30:48 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Travel]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[libraries]]></category>
		<category><![CDATA[Lightning Talks]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon2011]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://sirhc.us/?p=773</guid>
		<description><![CDATA[Thursday was the second day of sessions at the O&#8217;Reilly Open Source Convention (OSCON) and my third day in Portland, Oregon. Overall, the sessions I attended were arguably more relevant to my work than those I attended on Wednesday. Still, &#8230; <a href="http://sirhc.us/oscon-2011-thursday/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Thursday was the second day of sessions at the <a href="http://www.oscon.com/oscon2011/">O&#8217;Reilly Open Source Convention</a> (OSCON) and my third day in Portland, Oregon.  Overall, the sessions I attended were arguably more relevant to my work than those I attended on Wednesday.  Still, the day left me feeling unsatisfied.  At past OSCONs, I ended each day with my mind brimming with new ideas, scarcely able to wait until I could put some of them into practice.  So far, this year&#8217;s conference hasn&#8217;t had the same effect on me.</p>
<p>In any case, the Thursday morning keynotes were far better than those foisted upon us on Wednesday morning.  Gabe Zichermann&#8217;s talk, in particular, caught my attention.  In <strong><a href="http://www.oscon.com/oscon2011/public/schedule/detail/20826">Game theory applied to user engagement in Open Source</a></strong> he talked about using so-called gamification techniques to draw people into using Open Source software.  Many of his examples had to do with using game theory to alter real life behavior, such as a <a href="http://theage.drive.com.au/roads-and-traffic/speed-camera-rewards-drivers-20101129-18d3i.html">lottery to reward good drivers in Sweden</a> or the use of consumption graphs in hybrid vehicles.  On a separate note, I tend to grow annoyed at the latter, having been stuck behind too many <a href="http://en.wikipedia.org/wiki/Hypermiling">hypermiling</a> drivers.</p>
<p>Getting into the sessions, I favored those more in line with the work I do as a Perl programming system administrator.  Also, it didn&#8217;t hurt that <strong><a href="http://www.oscon.com/oscon2011/public/schedule/detail/18581">The Conway Channel 2011</a></strong> happened to take place during the first time slot of the day.  I&#8217;m a bit sorry I passed up <a href="http://www.oscon.com/oscon2011/public/schedule/detail/19247">DIY Clinical Trials (Or: How to Guinea Pig Your Way to Scientific Truth and Better Health)</a>, if only for the reason that it would have been completely different from anything I normally do.  But, I attended those types of sessions on Wednesday, so it was back to business, so to speak.  Damian Conway was in his usual top form, as entertaining as he is educational.  I won&#8217;t go into too much detail, only to note that he demonstrated four of his modules, using a theme I&#8217;m sure most will recognize.  First, something old, updates to the <a href="https://metacpan.org/module/Regexp::Grammars">Regexp::Grammars</a> module.  He then introduced something new, the <a href="https://metacpan.org/module/IO::Prompter">IO::Prompter</a> module, which supersedes his older IO::Prompt.  There was something borrowed, the <a href="https://metacpan.org/module/Data::Show">Data::Show</a> module, which serves as a convenience wrapper around the <a href="https://metacpan.org/module/Data::Dump">Data::Dump</a> module.  And finally, something blue, the <a href="https://metacpan.org/module/Acme::Crap">Acme::Crap</a> module, which seems oddly cathartic.</p>
<p>I like to think I&#8217;m a halfway decent Perl programmer, but that doesn&#8217;t mean I think I can ignore things like Jacinta Richardson&#8217;s <strong><a href="http://www.oscon.com/oscon2011/public/schedule/detail/18870">Perl Programming Best Practices 2011</a></strong>.  The talk was a round-up of the tools and modules that are generally considered to be the best practices by the Perl community today.  Yes, generally.  People will have their differences of opinion, and I don&#8217;t always agree with the advertised best practices.  However, if followed, the practices will lead to better code, and if violating a practice, I like to be able to back that up with a well thought out reason (it doesn&#8217;t necessarily have to be a good reason).  The first of two, possibly pithy, examples of this is the <a href="https://metacpan.org/module/local::lib">local::lib</a> and it&#8217;s default use of <tt>~/perl5</tt> as its include path.  I prefer to use <tt>~/local/lib/perl5</tt> and, sure, the module allows me to do that easily enough, but it&#8217;s an extra, non-standard step.  Second, the <a href="https://metacpan.org/module/App::cpanminus">cpanm</a> has been touted as the best way to install modules from CPAN.  As a control freak with a highly customized CPAN configuration, I&#8217;ve never liked the way cpanm seems to do things its way.  Admittedly, it may be customizable, but I&#8217;ve never had the need to look into it.</p>
<p>There&#8217;s been some noise around the office about testing Amazon&#8217;s EC2 offering.  To that end, I thought James Loope&#8217;s <strong><a href="http://www.oscon.com/oscon2011/public/schedule/detail/18988">Utility and Automation: Low Overhead Operations with Amazon &amp; Puppet</a></strong> would be educational, possibly giving me some ideas about how to managing our own potential EC2 environment.  Unfortunately, it didn&#8217;t work out that way for me.  The talk was heavily focused on the way the web application was designed and pieces of Amazon&#8217;s infrastructure were used.  We&#8217;re not creating or running web applications, so none of it was beneficial to me.  There was nothing about Puppet aside from explaining that using it (or another configuration management tool) is vital for keeping everything running.</p>
<p>At this point, I was turned off from any cloud talks at OSCON.  There seems to be, with probably good reason, an inextricable tangling of cloud and web applications.  Because of this, I decided to pass on <a href="http://www.oscon.com/oscon2011/public/schedule/detail/18726">Achieving Hybrid Cloud Mobility with OpenStack and XCP</a> and instead attended Piers Cawley&#8217;s <strong><a href="http://www.oscon.com/oscon2011/public/schedule/detail/18577">Polymorphic Dispatch&mdash;It&#8217;s Not Just a Good Idea, It&#8217;s the Law</a></strong>.  I&#8217;m glad I did, because there were definitely some very useful ideas presented.  The idea, taken from Smalltalk, of passing messages to objects has a lot of merit.  Combining this with polymorphism, sending a message and allowing different objects to act on it differently, vastly simplifies code.  Simple code, of course, is easier to test and easier to debug when things go horribly wrong (and actually is less likely to go horribly wrong in the first place).  Of particular interest to me were the <a href="http://en.wikipedia.org/wiki/Null_Object_pattern">Null Object pattern</a> and what Piers referred to as the key tenant of object-oriented programming: tell, don&#8217;t ask.  That is to say, if I understood correctly, instead of querying an object for information and using it to determine which action to perform, give the information to the object and have it perform the action.  Finally, <a href="http://amzn.to/14ouCY"><em>Smalltalk Best Practice Patterns</em></a> was recommended as the best book on good coding practices out there.  According to Piers, it &#8220;will change the way you think about programming.&#8221;</p>
<p>I was in way over my head in Tom Christiansen&#8217;s <strong><a href="http://www.oscon.com/oscon2011/public/schedule/detail/19543">Unicode in Perl Regexes</a></strong>.  The only thing I managed to learn is that I don&#8217;t know nearly enough about Unicode to actually understand using it.  I&#8217;ll leave it at that.  It was a very information-dense session and it&#8217;s possible that Tom knows more about Unicode than those who designed it.  Other choices during this time slot, which may have been better for me, were <a href="http://www.oscon.com/oscon2011/public/schedule/detail/19548">Connecting iOS to the Real World with Arduino</a>, presented by my friend <a href="http://www.dailyack.com/">Alasdair Allan</a>, or, venturing again into the realm of health geekery, <a href="http://www.oscon.com/oscon2011/public/schedule/detail/18488">Open Source Preventive Medicine: Citizen Science Genomics</a></p>
<p>The last session I attended on Thursday had so much potential, but, for me, it fell flat.  I expected <a href="http://blog.qtau.com/">A. Sinan Unur</a>&#8216;s <strong><a href="http://www.oscon.com/oscon2011/public/schedule/detail/19211">Visualizing Economic Data Using Perl and HTML5&#8242;s Canvas</a></strong> to focus far more on visualization than it did.  Instead, the majority of the presentation was about the difficulty of parsing public data published by the United States government.  For this, Sinan uses <a href="https://metacpan.org/module/Spreadsheet::ParseExcel">Spreadsheet::ParseExcel</a> and explained a few of the techniques he uses to extract data from tables designed primarily for visual consumption.  Unfortunately, very little time was spent showing how Canvas was used.  We were given one static example and an explanation that there is no method available for determining the height of text in a Canvas element.  I had hoped to return to work with some ideas for using Canvas to visualize data from our batch scheduling system, but ultimately left disappointed.</p>
<p>After the last session, I met up with a coworker, an old friend, and a new friend to have dinner at Chipotle.  Normally, I like to avoid chain restaurants&mdash;national chains in particular&mdash;when traveling, preferring to sample the local cuisine.  But, we wanted a quick dinner and it was nearby.  My opinion was requested, on the relative healthfulness of pinto versus black beans.  I simply stated that I would be ordering my carnitas bowl without any beans.</p>
<p>After dinner, we returned to the convention center for the <a href="http://www.oscon.com/oscon2011/public/schedule/detail/21120">Perl Lightning Talks and the State of the Onion</a>.  As always, the talks were quite entertaining.  Of note was a juggling demonstration, illustrating various programming languages and databases.  Near the end, Ricardo Signes recounted a conversation he had with a couple of women from the knitting conference sharing the convention center with us.  Its presence provided a wonderful juxtaposition.  While OSCON is male-dominated and many don&#8217;t know how to act when women brave their way into our midst, the knitting convention is completely opposite.  Ricardo&#8217;s message to us was, take the time to look up from our laptops and chat with those around us.  We might just have a better time and make new friends.</p>
<p>Finally, Piers Cawley favored us, as he does every year, with a song.  This year, however, he did not bear a tale of levity, but a message of deadly seriousness.  The United Kingdom is closing libraries in an attempt to reduce public spending.  As a protest, Piers wrote a song, <a href="http://soundcloud.com/pdcawley/child-of-the-library">&#8220;Child of the Library&#8221;</a>.  There doesn&#8217;t appear to be any video (yet) of Piers performing at OSCON, but I&#8217;ve gone ahead and embedded one that I found.  It&#8217;s catchy, I had it stuck in my head for a couple of days after the conference.</p>
<p><iframe width="560" height="349" src="http://www.youtube.com/embed/VwZk8DMWTOA" frameborder="0" allowfullscreen></iframe></p>
<p>We could easily see the same thing happen in the United States&mdash;and in fact I have already seen it <a href="http://www.nbcsandiego.com/news/politics/Now-They-Might-Close-Libraries-104040374.html">proposed in San Diego</a>.  I&#8217;ll first admit that I have not set foot inside a library since college, over a decade ago (high school, if only counting public libraries).  Do libraries still matter, or is the concern over their closing merely the knee-jerk nostalgia of those of us who came of age in a world that didn&#8217;t yet know the Internet?  I can&#8217;t, and won&#8217;t, take a side on this issue until I&#8217;ve taken the time to visit my local library.  If I can recognize it as something I saw in my childhood, perhaps it should be closed.  If it has adapted to the so-called Information Age, maybe it&#8217;s worth funding.</p>
<p>As a final, humorous note, I almost didn&#8217;t make it back to my hotel.  At least, not without finding an alternate method of transportation.  At 10:22 PM, excusing myself and apologizing for staying so far away from the conference, I left Media Temple party at the Jupiter Hotel, arriving at the convention center MAX station at 10:32 PM.  The schedule at the station listed 10:42 PM as the last red line train to the airport, with Google Maps concurring that a train was 10 minutes away.  About two minutes later an unmarked blue line train arrived at the station, traveling east.  At this point, Google Maps had decided it would rather show me its trip planner instead of the previous screen which showed the impending arrival of the red line.  Forced to make a split-second decision, I hopped on the train.  I knew that I could take it at least as far as the Gateway station, where I could transfer to the red line if it was still behind me.  Around 11:00 PM I arrived at Gateway, after spending the ride thinking about how much a cab would cost.  This station had a real-time display with train arrival times.  The last red line of the day was only three minutes out.  Whew.</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2011-thursday/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>For Want of a Newline</title>
		<link>http://sirhc.us/for-want-of-a-newline/</link>
		<comments>http://sirhc.us/for-want-of-a-newline/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 05:29:47 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[arrogance]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[newline]]></category>
		<category><![CDATA[oops]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://sirhc.us/?p=698</guid>
		<description><![CDATA[Today I had the pleasure of spending three hours debugging an obscure bug. An obscure bug I caused by introducing a newline. That little punk, 0x0A. I released a new version of a command line program. It&#8217;s an elegant piece &#8230; <a href="http://sirhc.us/for-want-of-a-newline/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today I had the pleasure of spending three hours debugging an obscure bug.  An obscure bug I caused by introducing a newline.  That little punk, <tt>0x0A</tt>.</p>
<p>I released a new version of a command line program.  It&#8217;s an elegant piece of work, combining a marvelously complex-but-intuitive configuration for system administrators with a absolutely simple interface for users.  To use the command, the user runs it with a couple of arguments and it prints out a single line of useful text derived from the marvelously complex configuration.</p>
<p>But, it doesn&#8217;t print a newline.</p>
<p>Anyone who has encountered a command like this knows well my irritation.  You end up with something like this:</p>
<p><code>my awesome prompt&gt; <b>some_lame_command</b><br />
my awesome prompt&gt;e answer</code></p>
<p><i>Argh!</i></p>
<p>The workaround most of us use is to see the above, face-palm, then run something like this:</p>
<p><code>my awesome prompt&gt; <b>echo `some_lame_command`</b><br />
42 is obviously the answer<br />
my awesome prompt&gt;</code></p>
<p>Being the <a href="http://www.stonebrew.com/">arrogant bastard</a> programmer that I am, I decided to fix this.  Since <i>all</i> commands print newlines, everyone should already be assuming that this one does too and should already be handling it in the proper manner.  When writing a shell script, the distinction between newline-printing and non-newline-printing commands is irrelevant.  In either Bourne shell,</p>
<p><code>FROBBED=`frobnosticate`</code></p>
<p>or C shell,</p>
<p><code>setenv FROBBED `frobnosticate`</code></p>
<p>the shell is benevolent enough to remove the newline, if it exists.  After all, this is the most commonly desired behavior when assigning command output to a variable.  However, things are a bit different when switching to a programming language, like Perl:</p>
<p><code>$ENV{FROBBED} = `frobnosticate`; <i># Caution, newline ahead!</i></code></p>
<p>Sure, it looks more or less the same, but veteran Perl programmers will immediately grimace when reading the above.  Unlike the shell, Perl, like other programming languages, will preserve the output of the command.  In this case, preserving data and letting the programmer decide how to use it is the most commonly desired behavior.  Since everything coming from an external command ends with a newline, the environment variable being set in this case will have a newline.  This will almost always cause a problem.  One that, as I&#8217;ve learned, is not always easy to find.  Since stripping input of newlines is just as common as the desire to preserve data, Perl makes this easy and most Perl programmers will habitually write this:</p>
<p><code>chomp( $ENV{FROBBED} = `frobnosticate` );</code></p>
<p>Now it doesn&#8217;t matter if the command prints a newline or not, the <code>chomp</code> function has your back.  It&#8217;s just like being in the warm embrace of the shell, only with a little extra syntax.</p>
<p>So it turns out that one of the engineering groups I support was using a Perl script that set an environment variable as in the first example.  The value of this environment variable was then being passed off to the batch system and used by an engineering program as a network address to connect to.  Of course, the program made the fatal mistake of trusting user input and, in a spectacular fashion, failed to connect to the server whose name just happened to contain a newline.</p>
<p>After chasing down a couple of red herrings which left me flummoxed, one of the affected users shared with me an error log and the script that generated it.  There, in all its syntax highlighted, monospaced glory was the environment variable being set without attempting to trim off the newline.  I quickly released an update that reverted the newline behavior and the problem went away.  My engineers&mdash;at least, the subset using this particular script&mdash;could once again get their work done.</p>
<p>By far, this isn&#8217;t the worst thing I&#8217;ve done to our batch system.  One time I caused all jobs that launched on Solaris hosts to immediately fail.  Whoops.</p>
<p>Anyway, what&#8217;s the lesson to be learned from today&#8217;s experience?</p>
<p>Never&mdash;and I&#8217;ll repeat that, <i>never</i>&mdash;assume everyone will be doing the right thing.  Inevitably, someone won&#8217;t be.</p>
<p>There&#8217;s a corollary to today&#8217;s lesson.  When coming across something that could be improved with a small change, don&#8217;t.  Seriously, just don&#8217;t.  Inevitably, someone will be depending on the current behavior, no matter how right or wrong it may seem.</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/for-want-of-a-newline/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSCON 2010: Tuesday</title>
		<link>http://sirhc.us/oscon-2010-tuesday/</link>
		<comments>http://sirhc.us/oscon-2010-tuesday/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 23:20:03 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Travel]]></category>
		<category><![CDATA[Beer]]></category>
		<category><![CDATA[fivefingers]]></category>
		<category><![CDATA[ignite]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon2010]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Portland]]></category>
		<category><![CDATA[rei]]></category>
		<category><![CDATA[vibram]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=471</guid>
		<description><![CDATA[I returned from the O&#8217;Reilly Open Source Convention three weeks ago, and I&#8217;ve had drafts for my Tuesday through Friday travel posts sitting around since then. I&#8217;ve finally found a moment on a lazy Sunday afternoon to enjoy a pint &#8230; <a href="http://sirhc.us/oscon-2010-tuesday/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I returned from the <a href="http://www.oscon.com/oscon2010/">O&#8217;Reilly Open Source Convention</a> three weeks ago, and I&#8217;ve had drafts for my Tuesday through Friday travel posts sitting around since then.  I&#8217;ve finally found a moment on a lazy Sunday afternoon to enjoy a pint of ale while writing.  Although, it is a beautiful day, which I&#8217;d be spending outdoors if my family weren&#8217;t sick (and I&#8217;m not convinced I&#8217;m altogether healthy).</p>
<p>Tuesday was the second and final day of the tutorial sessions.  In the morning I attended a tutorial on <a href="http://sirhc.us/journal/2010/07/21/oscon-2010-postgresql-reloaded/">PostgreSQL&#8217;s new hot stand-by and streaming replication features</a>; and, in the afternoon I attended part of a tutorial on <a href="http://sirhc.us/journal/2010/07/22/oscon-2010-hands-on-cassandra/">Cassandra</a>.  Why only part?  I&#8217;ll get to that.</p>
<p>I didn&#8217;t feel like going across the river to the food trucks for lunch, so I joined Debbie for lunch at <a href="http://burgerville.com/">Burgerville</a>.  Aside from the delicious food made from local ingredients, there are two things that struck me about Burgerville.  The first I noticed when I walked in the door: for the first time, disposing of my trash would require me to read instructions.  Burgerville uses three bins for trash: one for recyclable materials, one for compost, and finally one for trash that can neither be recycled nor composted.  I thought this was neat, though I did get a kick out of the soft drink cup.  It&#8217;s from the Coca-Cola company and advertises itself as something that can be composted; with the footnote that this was only possible in a large facility capable of composting such cups.  Not something one can throw into their garden compost pile, I guess.  The second thing I noticed caused me immediate regret: the receipt lists the calorie count of the foods ordered, along with carbohydrate and fiber content.  Looking over the details of the burger, onion rings, and raspberry milkshake I ordered, I decided that it would not be a very paleo day for me.  Oh well, the milkshake was very good.</p>
<p>While enjoying our carb-loaded, calorie-filled lunch, Debbie noticed someone wearing a pair of Vibram FiveFingers that we hadn&#8217;t seen before.  From a distance, they looked almost like normal shoes and appeared to be made with a dark brown suede.  With both of us deciding that a post-lunch, calorie-burning walk was called for, and sharing a desire to buy a new pair of FiveFingers, we set out for <a href="http://www.rei.com/stores/13">Portland&#8217;s REI</a> store.  A trip on the MAX, a walk, a few blocks on the trolley, and another walk brought us to the store.</p>
<p>The shoes turned out to be the <a href="http://www.vibramfivefingers.com/products/products_kso_trek_m.cfm">KSO Trek</a>.  They&#8217;re very nice and I&#8217;m considering purchasing a pair for hiking.  Unfortunately, I struck out on the trip.  REI has been having a hard time keeping FiveFingers in stock, so I wasn&#8217;t able to find or buy a pair of the Classic version.  Fortunately, I&#8217;m still satisfied with my KSOs, which I was wearing at the time.</p>
<p>Our impromptu quest for footwear took us well beyond the alloted time for lunch.  Fortunately, this time was not wasted.  While walking, we had received a call from our coworker back in the expo hall, who needed help setting up the <a href="http://www.quicinc.com/">QuIC</a> booth.  For some reason, it was fun being allowed into the expo hall while booths were still being constructed.  Not sure why, other than that I enjoy seeing things taken apart and (sometimes) being put back together.  After getting the booth set up, I made it to the second half of the Cassandra tutorial.  I&#8217;m told by those who attended the first half that I didn&#8217;t miss much.</p>
<p>We had some time to kill between the end of the day&#8217;s sessions and the evening&#8217;s Ignite talks.  So we walked a few blocks to a place called <a href="http://www.rontoms.net/">rontoms</a>.  Had I not been looking for the specific address, I would have walked right past, not noticing that this was either a restaurant or a bar.  The cavernous interior was devoid of anyone save the bartender and a waitress, who would disappear as quickly as she appeared.  The photographs on the wall, ost of which featured a man in an animal costume, ranged from strange to disturbing.  After a moment&#8217;s hesitation, we ventured out back to find a patio crowded with patrons enjoying food, beer, and spirits.  With what appeared to be only a single waitress working and not having particularly strong appetites, we went back inside, obtained pints directly from the bartender, and found a comfortable area to sit and chat.  Twice we encountered people entering the restaurant, looking for people they didn&#8217;t know by sight.  Both times my colleagues convinced them that we were those people; one girl even sat down with us for a few minutes before we let her in on the joke.  After a while, I received a page from Jonathan that there was beer, salami, and cheese being served outside the ballroom at the convention center.  This sounded like an excellent and delicious dinner to me, so I made my way back.</p>
<p>I hadn&#8217;t been to an <a href="http://www.oscon.com/oscon2010/public/schedule/detail/14332">Ignite</a> session before, so I was looking forward to this one.  Right off the bat we were warned that we would likely enjoy some talks and dislike others.  Fortunately, each talk would only last five minutes, so we were free to use the time to retrieve another beer.  By the time we returned, the talk would be over.  I don&#8217;t believe I took advantage of this, instead waiting for the break, during which some awards were being presented.</p>
<p>Two talks stand out in my memory.  The first, perhaps appropriately, was the first in the lineup: Paul Fenwick talking about <a href="http://www.oscon.com/oscon2010/public/schedule/detail/15650">Maximum XP: Optimising life for adventure</a> (which he gave again, at a much better pace, at the <a href="http://www.oscon.com/oscon2010/public/schedule/detail/13183">Perl Lightning Talks</a>).  Presented in song, Paul&#8217;s message seemed to be to enjoy travel and to take advantage of opportunities to meet people and have fun.  Based on what I&#8217;ve read on his <a href="http://twitter.com/pjf">Twitter stream</a>, I&#8217;d say he&#8217;s been successful.</p>
<p>The other talk, <a href="http://www.oscon.com/oscon2010/public/schedule/detail/15513">Your Infinite Do-Loop Exercises Bores Me</a>, struck a chord with me.  John Scott and Jim Stogdill paired up for this talk, one would perform exercises while the other would speak, switching places at the halfway mark.  Not only was it refreshing to see a talk about fitness at a convention populated by a class of people not known for their physical exertion, but it was about a method of fitness I&#8217;ve recently become interested in.  While I don&#8217;t practice <a href="http://crossfit.com/">CrossFit</a> myself, I frequently look at the exercises on the site and prefer it to the typical, repetitive gym workout.  They also mentioned the <a href="http://paleodiet.com/">paleo diet</a>, which, along with the <a href="http://www.marksdailyapple.com/primal-blueprint-101/">primal lifestyle</a>, I&#8217;ve become a big fan of.</p>
<p>My coworkers all turned in early, so I hopped back on the MAX and headed downtown to have drinks with <a href="http://kevin.scaldeferri.com/blog/">Kevin</a> at <a href="http://www.baileystaproom.com/">Bailey&#8217;s Tap Room</a>.  I had a wonderful sour beer, which I no longer remember the name or origin of, and had the pleasure of meeting Steve, Jeff, and <a href="http://use.perl.org/~schwern/journal/">Michael Schwern</a>.  Jeff and Schwern were discussing the use of the <a href="http://search.cpan.org/dist/Log-Log4perl/">Log4perl</a> module in the latter&#8217;s <a href="http://github.com/gitpan">gitpan project</a>.</p>
<p>After last call at Bailey&#8217;s, I caught the last yellow line across the river and turned in myself.</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2010-tuesday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSCON 2010: State of the Onion</title>
		<link>http://sirhc.us/oscon-2010-state-of-the-onion/</link>
		<comments>http://sirhc.us/oscon-2010-state-of-the-onion/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 02:07:27 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Larry Wall]]></category>
		<category><![CDATA[live demo]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon2010]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[perl 6]]></category>
		<category><![CDATA[Rakudo Star]]></category>
		<category><![CDATA[State of the Onion]]></category>
		<category><![CDATA[uncertainty]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=523</guid>
		<description><![CDATA[The Thursday sessions are over, but before I head out to the parties, I&#8217;m attending the 14th State of the Onion address. This is the always well-attended update on the universe of Perl. I immediately noticed that Larry is surrounded &#8230; <a href="http://sirhc.us/oscon-2010-state-of-the-onion/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The Thursday sessions are over, but before I head out to the parties, I&#8217;m attending the 14th <a href="http://www.oscon.com/oscon2010/public/schedule/detail/14339">State of the Onion</a> address.  This is the always well-attended update on the universe of Perl.  I immediately noticed that Larry is surrounded by his wife and his son, the former dressed as an angel, the latter as a devil.</p>
<p>Larry claims that so rarely does he talk about Perl in the States of the Onion addresses that he has brought his conscience with him today to prod him in the right direction (the aforementioned angel and devil).</p>
<p>The current state of the onion is segmented into left, central, and right sections.  It can be labeled, say, 5 and 6.  They can also be labeled 0 and 1, for false and true.  Larry then asked a series of boolean questions, asking the audience to weigh in on the veracity.</p>
<p><strong>Do you think Perl 5 and Perl 6 are really the same language?</strong></p>
<p><strong>Do you think Perl 5 and Perl 6 are really different languages?</strong></p>
<p>As the angel and the devil argued, Larry pointed out that an important skill for a language designer is to be able to stay on the fence long enough until he can determine which side the grass is greener on.  Sometimes you discover that you&#8217;re sitting on the wrong fence and the voices in your head start to argue about which side has the greener grass.</p>
<blockquote><p>When the voices in your head start arguing if the purple cow eats greener grass than the brown fence, it&#8217;s time to see a doctor.  Or find a better drug dealer.</p>
<p>&mdash; Larry Wall</p></blockquote>
<p>This is, of course, a metaphor for being a language designer.  Sometimes you sit on the fence for language features, without ever knowing which direction is the better one.</p>
<p>Next up is a live demo of Perl 6; or, more specifically, of <a href="http://www.perlfoundation.org/perl6/index.cgi?rakudo_star">Rakudo Star</a>, which is scheduled to be released next week.  Some of the demos, without comment:</p>
<pre>.say if 6 %% $_ for 1..^6</pre>
<pre>[+] gather { take $_ if 6 %% $_ for 1..^6 }</pre>
<pre>[+] grep { 6 %% $_ }, 1..^6</pre>
<pre>~[+] grep 6 %% *, 1..^6</pre>
<pre>-> $n { $n == [+] grep $n %% *,  ..^ $n }</pre>
<pre>-> $n { $n == [+] grep $n %% *,  ..^ $n }(6)</pre>
<p>At this point, the examples scrolled off the screen due to a &#8220;whatever&#8221; example being run.  That&#8217;s good news, though.  It means Rakudo Star supports lazy lists and, as such, we finally have those infinite lists we&#8217;ve been promised:</p>
<pre>0, 1, ... *</pre>
<p>The whatever star can, in addition to being used as in an infinite series, can be used to curry a function:</p>
<pre>(1, 1, *+* ... *)[^20]    # Fibbonacci</pre>
<pre>(0, !* ... *)[^20]        # 0 1 0 1 0 1 ...</pre>
<p>In a recent video interview, Larry was asked, if he were hit by a bus, has he designated anyone to be his successor as the leader of the Perl 6 project?  His response was that he trusts the Perl community to choose the right person.</p>
<p>Onions can make you cry, so can disruptive technologies or innovations.  Almost everyone has labeled their technology as disruptive.  As such, the phrase has lost most of its meaning.</p>
<p>A disruptive technology simultaneously does something worse and does something better than its competitors.  In a time of the Unix philosophy of &#8220;do one thing and do it well,&#8221; Perl came along and attempted to do everything, but didn&#8217;t necessarily do any of it well.  The Unix philosophy was broken by its own utilities.  No one knew what a &#8220;thing&#8221; was, and no utility of the time did it well.  By the time Perl 4 turned into Perl 5, it demonstrated that a tool that was itself an entire tool shed could run circles around shell scripts.</p>
<p>In California, we once had many, many colonies of ants.  Now, most of California is populated by a <a href="http://en.wikipedia.org/wiki/Argentine_ant#Global_.22mega-colony.22">single colony of Argentine ants</a>.  This is because the colonies have forgotten how to fight with each other.  Perl 6 has benefited from multiple teams creating multiple implementations, in the end working together to create a better product, even if that product takes longer to complete.</p>
<blockquote><p>If you don&#8217;t like <a href="http://svn.pugscode.org/pugs/misc/camelia.txt">Camelia</a>, you can just fork off.</p>
<p>&mdash; Larry Wall</p></blockquote>
<p>The takeaway, I think: It is up to all of us to determine what Perl 6 will be.  What kind of disruptive technology will it be?</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2010-state-of-the-onion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSCON 2010: Awesome Things You&#8217;ve Missed in Perl</title>
		<link>http://sirhc.us/oscon-2010-awesome-things-youve-missed-in-perl/</link>
		<comments>http://sirhc.us/oscon-2010-awesome-things-youve-missed-in-perl/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 22:18:16 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon2010]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[pjf]]></category>
		<category><![CDATA[session]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=520</guid>
		<description><![CDATA[Paul Fenwick (Perl Training Australia) Ever since I saw An Illustrated History of Failure two years ago, I&#8217;ve made it a point to see @pjf&#8216;s talks. That&#8217;s how I find myself in his mid-afternoon session, Awesome Things You&#8217;ve Missed in &#8230; <a href="http://sirhc.us/oscon-2010-awesome-things-youve-missed-in-perl/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><em><a href="http://www.oscon.com/oscon2010/public/schedule/speaker/6631">Paul Fenwick</a> (Perl Training Australia)</em></p>
<p>Ever since I saw <a href="http://www.oscon.com/oscon2008/public/schedule/detail/3072">An Illustrated History of Failure</a> two years ago, I&#8217;ve made it a point to see <a href="http://twitter.com/pjf">@pjf</a>&#8216;s talks.  That&#8217;s how I find myself in his mid-afternoon session, <a href="http://www.oscon.com/oscon2010/public/schedule/detail/15764">Awesome Things You&#8217;ve Missed in Perl</a>.  Judging by the size of the crowd, I&#8217;m not the only one.  However, I won&#8217;t attempt to pass along his humour in this post.  I&#8217;d never do it justice.</p>
<p>In his introduction, Piers Cawley asked that we go wild when Paul took the stage, so the folks in the Google Wave session next door would be taken aback, and realize that Perl is not, in fact, dead.</p>
<p>People are still out there writing Perl as if still in the dark ages of 2008.  Paul doesn&#8217;t want us to write old Perl, but only new and shiny Perl.  This talk only covers practices that have come about since <em><a href="http://oreilly.com/catalog/9780596001735">Perl Best Practices</a></em> was released.</p>
<p>Object-oriented Perl is not awesome.  Not even close.  If you look at the old ways of doing it, all of them are either wrong, stupid, or both.  The rest are too hard.  There&#8217;s a simple way to fix this: use <tt><a href="http://search.cpan.org/dist/Moose/">Moose</a></tt>.  This module does so much of the infrastructure work of composing classes, it makes object-oriented programming enjoyable again.</p>
<p>Paul spent a lot of time giving a humorous, high-level overview of the features available in <tt>Moose</tt>.</p>
<p>The <tt>Moose</tt> module contains a huge number of extension modules in the <tt><a href="http://search.cpan.org/search?query=MooseX">MooseX</a></tt> namespace.</p>
<blockquote><p>When I have a problem, I go down to the pub with other Perl mongers and bitch.</p></blockquote>
<p>One of the limitations of Perl, that is exposed to <tt>Moose</tt>, is that not everything is an object.  This means methods like <tt>push()</tt> or <tt>isa()</tt> can&#8217;t be called on everything.  And checking types defeats the purpose of polymorphism.  Enter the <tt><a href="http://search.cpan.org/dist/autobox/">autobox</a></tt> module, which turns everything into an object.  As a bonus, it operates in lexical scope.  Moose exposes <tt>autobox</tt> through the <tt><a href="http://search.cpan.org/dist/Moose-Autobox/">Moose::Autobox</a></tt> module.</p>
<p>A module that Paul wrote, <tt><a href="http://search.cpan.org/dist/autodie">autodie</a></tt>, which is now included in core.  This lexically scoped module removes all of the boilerplate code that goes along with trapping errors from subroutines.</p>
<p>Not only is Perl 5.10 awesome, but Perl 5.10 regular expressions are awesome.  In particular, the introduction of named captures (via <tt>%+</tt>) made regular expressions extremely awesome.</p>
<p>Perl 5.10 also provides grammars in the regular expression engine.  This is the basis for Damian Conway&#8217;s <tt><a href="http://search.cpan.org/dist/Regexp-Gramars/">Regexp::Grammars</a></tt> module.</p>
<p>Referring to an article on <a href="http://sweeperbot.org/">SweeperBot</a> in <em><a href="http://www.theperlreview.com/">The Perl Review</a></em>.  However, there&#8217;s the problem of distributing a program that uses half of CPAN to users of inferior operating systems, such as Microsoft Windows.  That&#8217;s where the <a href="http://search.cpan.org/dist/PAR/"><tt>PAR</tt></a> module comes in.  It will pack up all of the modules used by the program, including the Perl interpreter itself if necessary, so a single, self-reliant file can be distributed to users who need it.</p>
<p>Remember to never optimize code.  Programmer time is far more valuable than CPU time.  However, when you must optimize code, profile first.  The <a href="http://search.cpan.org/dist/Devel-NYTProf/"><tt>Devel::NYTProf</tt></a> makes profiling awesome.</p>
<p>Code reviews are important, but Perl programmers are lazy.  Fortunately, the <a href="http://search.cpan.org/dist/Perl-Critic/"><tt>Perl::Critic</tt></a> module has read <em>Perl Best Practices</em> for you and will complain about where your code violates the practices in the book.  At my day job, it does about half the work of code reviews for me, loudly announcing violations of the coding standards that I enforce with an iron fist.</p>
<p>If you find an awesome module, buy the author a beer if you have the opportunity.  There&#8217;s also <a href="http://cpanratings.perl.org/">CPAN Ratings</a> to leave feedback or <a href="http://search.cpan.org/perldoc?perlthanks"><tt>perlthanks</tt></a> in recent versions of Perl.</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2010-awesome-things-youve-missed-in-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSCON 2010: 21st Century Systems Perl</title>
		<link>http://sirhc.us/oscon-2010-21st-century-systems-perl/</link>
		<comments>http://sirhc.us/oscon-2010-21st-century-systems-perl/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 21:22:18 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon2010]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[perl is not dying]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=516</guid>
		<description><![CDATA[Matt Trout (Shadowcat Systems Limited) The full title of this session is, 21st Century Systems Perl &#8211; the New Perl Enlightment for sysadmins Introduction While Perl isn&#8217;t dying, &#8220;PERL&#8221; most certainly is dying. This is a good thing, because it &#8230; <a href="http://sirhc.us/oscon-2010-21st-century-systems-perl/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.oscon.com/oscon2010/public/schedule/speaker/6644"><em>Matt Trout (Shadowcat Systems Limited)</em></a></p>
<p>The full title of this session is, <a href="http://www.oscon.com/oscon2010/public/schedule/detail/14095">21st Century Systems Perl &#8211; the New Perl Enlightment for sysadmins</a></p>
<p><b>Introduction</b></p>
<p>While Perl isn&#8217;t dying, &#8220;PERL&#8221; most certainly is dying.  This is a good thing, because it includes all the really crappy stuff, such as <a href="http://www.scriptarchive.com/">Matt&#8217;s Script Archive</a>.  Thank goodness for that.  To be fair, this code would have been horrible written in any language.  Remember, blame the artist, not the tool.</p>
<p>We have a very mature community, which means we also have very mature practices.  We are also converging on a standard platform, even if there are more than one ways to do something.</p>
<p><b>Part 1: Minimising Developer Fatalities</b></p>
<p>As a developer, we should do what we can to make our sysadmins&#8217; lives easier.</p>
<p>Right off the bat, we should use the <a href="http://search.cpan.org/dist/local-lib/"><tt>local::lib</tt></a> module, which allows an application to use custom library areas without polluting the system installation areas.  It can even work with <tt>/etc/skel</tt>.  Matt is a big fan of using a local library path, included with the application, so it can be maintained separately from both the operating system vendor&#8217;s modules and even other applications.</p>
<p>Improve module installation using <a href="http://search.cpan.org/dist/Module-Install/"><tt>Module::Install</tt></a>.</p>
<p>Package modules for your distribution of choice using <a href="http://search.cpan.org/perldoc?cpan2dist"><tt>cpan2dist</tt></a>.</p>
<p>Improve the CPAN experience using <a href="http://search.cpan.org/dist/App-cpanminus/"><tt>App::cpanminus</tt></a>, which is amazing easy to bootstrap:</p>
<pre>&gt; wget cpanmin.us
&gt; ./cpanm</pre>
<p>Start using all of the modules associated with best practices by installing <a href="http://search.cpan.org/dist/Task-Kensho/"><tt>Task::Kensho</tt></a>.</p>
<p>Vendors are getting better at distributing Perl and keeping up with module releases.  The Debian Perl team is the strongest, with Fedora lagging quite a bit far behind.  Fedora is finally getting better, now that members of the Perl community have a say in the packaging of Perl and the modules.</p>
<p>After many debug sessions, Matt has come to the conclusion that <tt>mod_$lang</tt> is evil.  Jamming languages into the web server is a bad, bad idea.  However, actually hooking into the different handlers can be useful.  Matt&#8217;s preference now is now <tt>FastCGI</tt>.</p>
<p><b>Part 2: Maximising Automation Banality</b></p>
<p>&#8220;In the systems world, shiny and exciting is not good.&#8221;</p>
<p>Use the <a href="http://search.cpan.org/dist/autodie/"><tt>autodie</tt></a> (in core as of 5.10) and the <a href="http://search.cpan.org/dist/IPC-System-Simple/"><tt>IPC::System::Simple</tt></a> modules to reduce the repetitiveness and the common errors of systems programming.</p>
<p>Use <a href="http://search.cpan.org/dist/IO-All/"><tt>IO::All</tt></a> to fix the syntax and semantics of I/O operations.</p>
<p>Systems script shouldn&#8217;t need to be deployed.  It should be possible to just drop the script onto a host and it will Just Work.  That&#8217;s where <a href="http://search.cpan.org/dist/PAR-Packer/"><tt>PAR::Packer</tt></a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2010-21st-century-systems-perl/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>OSCON 2010: Dist::Zilla</title>
		<link>http://sirhc.us/oscon-2010-distzilla/</link>
		<comments>http://sirhc.us/oscon-2010-distzilla/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 19:11:01 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[cpan]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Dist::Zilla]]></category>
		<category><![CDATA[distribution]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[laziness]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon2010]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[session]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=511</guid>
		<description><![CDATA[Ricardo Signes (Pobox.com) The full title of this talk is, Dist::Zilla &#8211; Maximum Overkill for CPAN Distributions. Every CPAN distribution contains a significant amount of crap. It&#8217;s infrastructure used for the distribution tools. ExtUtils::MakeMaker has been the traditional way to &#8230; <a href="http://sirhc.us/oscon-2010-distzilla/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.oscon.com/oscon2010/public/schedule/speaker/3189"><em>Ricardo Signes (Pobox.com)</em></a></p>
<p>The full title of this talk is, <a href="http://www.oscon.com/oscon2010/public/schedule/detail/13632">Dist::Zilla &#8211; Maximum Overkill for CPAN Distributions</a>.</p>
<p>Every CPAN distribution contains a significant amount of crap.  It&#8217;s infrastructure used for the distribution tools.</p>
<p><a href="http://search.cpan.org/dist/ExtUtils-MakeMaker/"><tt>ExtUtils::MakeMaker</tt></a> has been the traditional way to work on the infrastructure code.  By necessity, it contains a lot of legacy, which can be cumbersome to maintain.  Enter <a href="http://search.cpan.org/dist/ExtUtils-MakeMaker/"><tt>Module::Install</tt></a>, which can look in the expected places for the necessary information, such as the author name.  But, the author still must write all the boilerplate.  <a href="http://search.cpan.org/dist/ExtUtils-MakeMaker/"><tt>Module::Starter</tt></a> was written to address this, composing all the boilerplate on behalf of the author.  There is so much boilerplate that, by default, Module::Starter also provides a boilerplate test to detect it.</p>
<p>Why are we doing all of this?  How much repetitive work are we doing?</p>
<p>What can <a href="http://search.cpan.org/dist/Dist-Zilla/"><tt>Dist::Zilla</tt></a> do for us?  For starters, we can remove some files:</p>
<ul>
<li><tt>LICENSE</tt></li>
<li><tt>MANIFEST.SKIP</tt></li>
<li><tt>Makefile.PL</tt></li>
<li><tt>README</tt></li>
<li><tt>t/pod.t</tt></li>
<li><tt>t/pod-coverage.t</tt></li>
</ul>
<p>Leaving us with only our <tt>Changes</tt> file, our code, and our tests.  The non-infrastructure parts.  On top of that, <tt>Dist::Zilla</tt> does all of the boring distribution bits for us.  It only handles the <tt>make dist</tt> command.  It does not handle the <tt>make install</tt> command, which means the users who install the module don&#8217;t need all of the dependencies.</p>
<p><tt>Dist::Zilla</tt> puts all of its functionality into plugins, which will be the meat of the rest of this session.  It also uses a very simple INI-style configuration file.</p>
<p>The main command provided by the module is <tt>dzil build</tt>.  This bundles the distribution, which will contain all of the infrastructure necessary for users to install the module.  When building, it follows a simple work flow:</p>
<ol>
<li>Gather files</li>
<li>Munge files</li>
<li>Collect metadata</li>
<li>Write out</li>
</ol>
<p>There is no default configuration, but there is a <a href="http://search.cpan.org/perldoc?Dist::Zilla::PluginBundle::Basic">Basic plugin bundle</a> that will include all of the most common plugins.</p>
<p>What followed were examples of what the plugins can do.  Of course, all of them are designed to reduce cruft&mdash;the non-code, non-documentation bits that we&#8217;re forced to maintain.  The philosophy is the same one I advocate to anyone who will listen: computers are good at doing boring, repetitive tasks with derived data; why don&#8217;t we let them do more of that stuff?</p>
<p>I&#8217;ve followed <a href="http://twitter.com/rjbs">@rjbs</a> on Twitter for a while, and I&#8217;ve seen him talk about <tt>Dist::Zilla</tt>.  I&#8217;ve wanted to try it out for a while, to simplify my distributions&mdash;both for CPAN and for my day job&mdash;but I didn&#8217;t realize until this session just how awesome the tool is.  It&#8217;s a complete framework for managing Perl module distributions.  <tt>Dist::Zilla</tt> will give my <a href="http://c2.com/cgi/wiki?LazinessImpatienceHubris">Laziness</a> score a huge bump.</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2010-distzilla/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSCON 2010: Smalltalk-style Traits</title>
		<link>http://sirhc.us/oscon-2010-smalltalk-style-traits/</link>
		<comments>http://sirhc.us/oscon-2010-smalltalk-style-traits/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 00:07:07 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[inheritance]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon2010]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[roles]]></category>
		<category><![CDATA[smalltalk]]></category>
		<category><![CDATA[traits]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=492</guid>
		<description><![CDATA[Curtis &#8220;Ovid&#8221; Poe (BBC) After a long break, an apple, a cup of coffee, and a beer, I&#8217;m back in the Perl track. The full title of this session is, Scratching the 40-Year Itch of Inheritance with Smalltalk-style Traits. This &#8230; <a href="http://sirhc.us/oscon-2010-smalltalk-style-traits/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><em><a href="http://www.oscon.com/oscon2010/public/schedule/speaker/6639">Curtis &#8220;Ovid&#8221; Poe (BBC)</a></em></p>
<p>After a long break, an apple, a cup of coffee, and a beer, I&#8217;m back in the Perl track.</p>
<p>The full title of this session is, <a href="http://www.oscon.com/oscon2010/public/schedule/detail/12529">Scratching the 40-Year Itch of Inheritance with Smalltalk-style Traits</a>.</p>
<p>This is not a tutorial.  How to use <a href="http://en.wikipedia.org/wiki/Trait_(computer_science)">traits</a> is easy, but why to use them is a more complex discussion.</p>
<p>Inheritance is a very complex problem and an easy one to get wrong.  Then people start doing things with <a href="http://en.wikipedia.org/wiki/Multiple_inheritance">multiple inheritance</a> and, even if they&#8217;re not doing something deliberately stupid, they end up with <a href="http://en.wikipedia.org/wiki/Diamond_problem">diamond inheritance</a>.  Not only is this a problem, but it&#8217;s been a problem for a very long time&mdash;40 years, in fact.</p>
<p>Complex systems can lead to deep class hierarchies.  When hierarchies are deep, in particular with a dynamic language like Perl, it becomes difficult to determine where a method came from.  Even when its known where a method comes from, undesired behavior may be inherited.  This becomes worse when multiple inheritance is used.</p>
<p>As systems grow, the problem becomes two-fold:</p>
<ol>
<li>Class responsibility &#8211; larger classes are desired</li>
<li>Class reuse &#8211; smaller classes are desired</li>
</ol>
<p>Inheritance, by itself, cannot solve this problem.  So the solution is to<br />
decouple the sub-problems.</p>
<p>Several solutions have been tried:</p>
<ul>
<li>Interfaces</li>
<li>Delegation</li>
<li>Mixins &#8211; incredibly popular</li>
</ul>
<p>As expected by the name of this session, traits (or roles in the nomenclature of Moose) solve the problem far better than any of the above solutions.  Much of the session involved showing real-world application of roles to clean up code at the BBC.</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2010-smalltalk-style-traits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSCON 2010: Cool Perl 6 Today</title>
		<link>http://sirhc.us/oscon-2010-cool-perl-6-today/</link>
		<comments>http://sirhc.us/oscon-2010-cool-perl-6-today/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 21:18:41 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon2010]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[perl 6]]></category>
		<category><![CDATA[session]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=484</guid>
		<description><![CDATA[Patrick Michaud (pmichaud.com) I&#8217;m just back from lunch at Burgerville with Juan and Jonathan. On the way back into the convention center, I ran into Alasdair, who has been attending the hardware hacking sessions. That made me think that I &#8230; <a href="http://sirhc.us/oscon-2010-cool-perl-6-today/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><em>Patrick Michaud (pmichaud.com)</em></p>
<p>I&#8217;m just back from lunch at <a href="http://burgerville.com/">Burgerville</a> with Juan and Jonathan.  On the way back into the convention center, I ran into <a href="http://www.dailyack.com/">Alasdair</a>, who has been attending the hardware hacking sessions.  That made me think that I may want to try to find non-Perl sessions to attend.  After all, I tend to keep up with Perl news, so the sessions are of marginal usefulness.  Unfortunately, nothing on the schedule looked very interesting to me.  I was curious about the session on <a href="http://www.oscon.com/oscon2010/public/schedule/detail/13949">Open Source Tool Chains for Cloud Computing</a> until I read the description.  While it looked cool, it wouldn&#8217;t be useful for me in my work.  The session would go through provisioning, setup, and maintenance of hosts, all of which we already have well-entrenched solutions for in my day job.  So, I ended up back in the Perl track.  My friends in the <a href="http://sandiego.pm.org/">San Diego Perl Mongers</a> group will appreciate that, I think.</p>
<p>Anyway, on to the session.</p>
<p>The name <a href="http://perl6.org/">Perl 6</a> is a language specification, rather than any particular implementation.  All of the references and links off-handedly mentioned in this post are available from the Perl 6 website.</p>
<p>Patrick is the lead developer of Rakudo Perl, which is the most feature complete and up-to-date.</p>
<p>Perl 6 has a language specification and a test suite.  There are still many places in Perl 6 that are not being tested yet.</p>
<p>Rakudo * (Star) is scheduled to be released a week from tomorrow, targeted at being a useful, usable, early adopter distribution.</p>
<p>At this point, Patrick began to enumerate the new language features and how they work in Perl 6, such as variables, loops, interpolation, and so on.  I won&#8217;t go into these here, since there are numerous places on the Web where this has been documented.</p>
<p>About half way through this session, I realized that <a href="http://www.oscon.com/oscon2010/public/schedule/speaker/6635">&#8220;r0ml&#8221;</a> was presenting in another room.  If I&#8217;d noticed that before, I would have attended <a href="http://www.oscon.com/oscon2010/public/schedule/detail/13891">that session</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2010-cool-perl-6-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSCON 2010: Perl 5.12</title>
		<link>http://sirhc.us/oscon-2010-perl-5-12/</link>
		<comments>http://sirhc.us/oscon-2010-perl-5-12/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 19:09:13 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon2010]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[pumpking]]></category>
		<category><![CDATA[release management]]></category>
		<category><![CDATA[session]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=481</guid>
		<description><![CDATA[Jesse Vincent (Best Practical) This talk could be titled something along the lines of &#8220;Lessons Learned from Project Management.&#8221; Jesse Vincent is the current Perl 5 pumpking, which for the moment can be thought of as the project janitor. People &#8230; <a href="http://sirhc.us/oscon-2010-perl-5-12/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><em>Jesse Vincent (Best Practical)</em></p>
<p>This talk could be titled something along the lines of &#8220;Lessons Learned from Project Management.&#8221;</p>
<p>Jesse Vincent is the current Perl 5 <a href="http://www.socialtext.net/perl5/index.cgi?pumpking">pumpking</a>, which for the moment can be thought of as the project janitor.</p>
<p>People who say &#8220;Perl is dead&#8221; or that Perl hackers are &#8220;desperate&#8221; are behind the times.</p>
<p>There are a lot of exiting things happening that are not in the Perl core.  Audrey Tang has said that &#8220;CPAN is the language, Perl is the syntax.&#8221;  Like Piers in the <a href="http://sirhc.us/journal/2010/07/21/oscon-2010-new-beginnings-in-perl-5/">previous session</a>, Jesse enumerated a handful of things that make Perl awesome:</p>
<ul>
<li><a href="http://search.cpan.org/dist/Moose/"><tt>Moose</tt></a></li>
<li><a href="http://search.cpan.org/dist/Plack/"><tt>Plack</tt></a></li>
<li><a href="http://search.cpan.org/dist/App-cpanminus/"><tt>cpanm</tt></a> &#8211; makes installing CPAN modules Just Work</li>
<li><a href="http://search.cpan.org/dist/Devel-Declare/"><tt>Devel::Declare</tt></a></li>
<li><a href="http://search.cpan.org/dist/Devel-NYTProf/"><tt>Devel::NYTProf</tt></a></li>
</ul>
<p>While some of the coolest new things happening in the CPAN world, it merely scratches the surface of what is available.</p>
<p>About three months ago, Jesse uploaded <a href="http://search.cpan.org/~jesse/perl-5.12.0/">Perl 5.12</a>.  Amazingly, no one has reported any critical regressions.</p>
<p>Jesse has been assured that <a href="http://www.perlfoundation.org/perl6/index.cgi?rakudo_star">Rakudo *</a> will be out next week, on 29 July.  However, Perl 6 will not replace Perl 5, which has paid Jesse&#8217;s mortgage for many, many years.  Also, thanks to Perl 5.12, Perl 5.10 is no longer &#8220;too new to use.&#8221;</p>
<p>Perl 5.12 marks the latest release in the process of cleaning up the inernals and adding much desired features.  Some of the highlights:</p>
<ul>
<li>Deprecations warn by default</li>
<li><tt>suidperl</tt> is dead</li>
<li><tt>package Foo::Bar 1.0;</tt> &#8211; better version import syntax</li>
<li>Y2038 compliant &#8211; thanks to Schwern</li>
<li>Unicode improvements; upgrade to 5.2</li>
<li>Pluggable keywords</li>
<li>Overridable function lookup</li>
<li>Dtrace support</li>
<li>Deprecated modules &#8211; <tt>Class::ISA</tt>, <tt>Pod::Plainer</tt>, <tt>Shell</tt>, <tt>Switch</tt> (but still on CPAN)</li>
<li>Yadda, yadda, yadda operator</li>
</ul>
<p>Jesse believes the best new thing in Perl 5.12 is the release process, including him as the pumpking.  Twenty years ago, Perl didn&#8217;t use version control.  He recommends learning from this mistake.</p>
<p>It took five years to release Perl 5.10, after burning through two pumpkings.</p>
<p>Before 5.12, maintenance releases contained all sorts of bug fixes and updates, but could not break binary compatibility.  Doing so was a huge task, was very difficult, and, contrary to its name, is unmaintainable.  Even without all this work, the pumpking&#8217;s job is a lot of work.  Jesse really doesn&#8217;t want to burn out after a release of Perl.</p>
<p>Traditionally, the process of turning someone with the necessary skills to be the pumpking involves preventing them from using those skills and replacing them with management skills.  It&#8217;s a shame.</p>
<p>The system is broken and Perl 5 isn&#8217;t going anywhere, so how can it be fixed?  We can reinvent it, but that&#8217;s already being done by Perl 6.  Alternatively, we can refactor it.  There is no reason many of the skills and duties required of the pumpking can&#8217;t be delegated out to people with those skills.  In effect, the most important skill and duty for the pumpking is project management.</p>
<p>The 5.9 releases, leading up to 5.10, were haphazard.  The 5.11 releases, leading up to 5.12, have settled into a new release every month on the twentieth, with a couple of exceptions.  The 5.13 series has followed suit.  One of the reasons this was possible was documenting the entire release process.</p>
<p>Releases in the 5.12 series are on a fixed schedule, every three months.  A release schedule has been created for 5.14, too.</p>
<p>One of the things I&#8217;ve learned working in an enterprise and my observations of the Fedora Project is that good project management is vital.  Jesse Vincent is exactly what Perl needed and he continues to demonstrate that, with regular, high quality releases of Perl.  What&#8217;s more, he is a good spokesman for the project, being able to come to OSCON and give a session on all of this detail in a cojent and interesting format.</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2010-perl-5-12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSCON 2010: New Beginnings in Perl 5</title>
		<link>http://sirhc.us/oscon-2010-new-beginnings-in-perl-5/</link>
		<comments>http://sirhc.us/oscon-2010-new-beginnings-in-perl-5/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 18:12:00 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[frustration]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon2010]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[session]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=477</guid>
		<description><![CDATA[Piers Cawley (BBC) After reviewing today&#8217;s session schedule, I quickly came to the conclusion that I will spend my entire day sitting in the room &#8220;Portland 256.&#8221; This is, apparently, where the Perl track is located. Paul Fenwick introduced Piers &#8230; <a href="http://sirhc.us/oscon-2010-new-beginnings-in-perl-5/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><em>Piers Cawley (BBC)</em></p>
<p>After reviewing today&#8217;s session schedule, I quickly came to the conclusion that I will spend my entire day sitting in the room &#8220;Portland 256.&#8221;  This is, apparently, where the Perl track is located.</p>
<p><a href="http://www.twitter.com/pjf">Paul Fenwick</a> introduced Piers in song, to the tune of <em>Gilligan&#8217;s Island</em>.</p>
<p>Piers switched from Perl to Ruby a while back and swore that he wouldn&#8217;t return to Perl until 6.  Facetiously, the reason he switched to Ruby was the handsome community associated with it and he reason he switched back to Perl was the amazingly supportive community associted with it.  He began with a point about programming style.  We think of code as describing <em>what</em> we are doing, but in reality the majority of our code actually describes <em>how</em> we are doing it.  This infrastructure code is noise.</p>
<p>More seriously, he absolutely hated unrolling the <tt>@_</tt> variable in every function.  In such a high level language like Perl, why must we pop arguments off the stack in the same manner we would in an assembly language?  This leads to long subroutines, every single one containing anti-patterns designed to implement the language infrastructure, instead of the language doing the work for us.</p>
<p><a href="http://search.cpan.org/dist/Moose/"><tt>Moose</tt></a> does a lot to improve writing classes, using a more declarative syntax.  However, even within Moose methods we need to write the infrastructure code.  The <a href="http://search.cpan.org/dist/MooseX-Declare/"><tt>MooseX::Declare</tt></a> module solves this problem, giving method syntax a more declarative style.  By moving the infrastructure code out of sight, we can better focus on <em>what</em> we are trying to do, rather than <em>how</em> we are doing it.</p>
<p>Piers proceeded to list the modules that &#8220;rock&#8221; and brought him back to Perl:</p>
<ul>
<li><a href="http://search.cpan.org/dist/Plack/"><tt>Plack</tt></a></li>
<li><a href="http://search.cpan.org/dist/Devel-NYTProf/"><tt>Devel::NYTProf</tt></a></li>
<li><a href="http://search.cpan.org/dist/Moose/"><tt>Moose</tt></a></li>
</ul>
<p>Perl&#8217;s object-orientation absolutely &#8220;sucks.&#8221;  However, this turns out to be a good thing.  It allows very clever people to create modules that extend the semantics of the language.  In a language like Ruby, which has a good object-orientation built-in, it&#8217;s essentially stuck.  If, in the future better ideas of object-orientation are developed, they can be implemented in Perl far more easily than in Ruby.  An interesting point: sometimes when the tool sucks, things are better.  People develop layers of tools that enhance and extend the original.</p>
<p>It also helps that the Perl release schedule has accelerated.</p>
<p>Piers continued with a high-level, hand-waving explanation of how <tt>MooseX::Declare</tt> works.  While not informative, it was entertaining.  Including a video of Matt Trout attempting to hypnotize the room.</p>
<p>Piers ended by thanking the Perl community and expressing how good it feels to be back into it and developing in Perl again.</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2010-new-beginnings-in-perl-5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>OSCON 2008: The Twilight Perl</title>
		<link>http://sirhc.us/oscon-2008-the-twilight-perl/</link>
		<comments>http://sirhc.us/oscon-2008-the-twilight-perl/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 19:22:10 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Damian Conway]]></category>
		<category><![CDATA[ocon2008]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon08]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=277</guid>
		<description><![CDATA[It&#8217;s the last session of the conference, and I saw Damian Conway&#8217;s name on the schedule. So here I am, attending The Twilight Perl. I have no idea what to expect, but come on, it&#8217;s Damian. It&#8217;s got to be &#8230; <a href="http://sirhc.us/oscon-2008-the-twilight-perl/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s the last session of the conference, and I saw Damian Conway&#8217;s name on the schedule.  So here I am, attending <a href="http://en.oreilly.com/oscon2008/public/schedule/detail/2438">The Twilight Perl</a>.  I have no idea what to expect, but come on, it&#8217;s Damian.  It&#8217;s got to be good.</p>
<p>Based on past experience, this is likely to be a fast-paced, highly-entertaining talk.  One which will be impossible to summarize, or no doubt even to explain, here.  Needless to say, if you&#8217;re not here, you&#8217;re missing out.  I intend to sit back, relax, and enjoy.</p>
<p>He&#8217;s talking about the defining characteristic of a hacker.  Particularly when they&#8217;re told that something is impossible and can&#8217;t be done.  The reaction is typically, &#8220;you wanna bet?&#8221;</p>
<p>He just presented a slide that read, &#8220;Let&#8217;s leave behind the shackles of sanity&#8230;&#8221;</p>
<p>Now I&#8217;m scared.</p>
<p>This is a great talk.  It&#8217;s a series of examples of things &#8220;you can&#8217;t do in Perl.&#8221;  At least, not until Damian shows us how.</p>
<p>I think Brad may have <a href="http://www.canspice.org/2008/07/25/oscon-2008-the-twilight-perl-by-damian-conway/">taken notes</a>.  Which is good, because now I wish I had.</p>
<p>[tags]oscon, oscon08, ocon2008, Perl, Damian Conway[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2008-the-twilight-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSCON 2008: Perl and Parrot</title>
		<link>http://sirhc.us/oscon-2008-perl-and-parrot/</link>
		<comments>http://sirhc.us/oscon-2008-perl-and-parrot/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 18:22:58 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[myths]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon08]]></category>
		<category><![CDATA[oscon2008]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Tim Bunce]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=276</guid>
		<description><![CDATA[It&#8217;s the first session on Friday and I&#8217;m in Perl and Parrot: Baseless Myths and Startling Realities with Tim Bunce. As people were filtering in from the break, Tim displayed one of my favorite xkcd comics for us to enjoy. &#8230; <a href="http://sirhc.us/oscon-2008-perl-and-parrot/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s the first session on Friday and I&#8217;m in <a href="http://en.oreilly.com/oscon2008/public/schedule/detail/3242">Perl and Parrot: Baseless Myths and Startling Realities</a> with Tim Bunce.  As people were filtering in from the break, Tim displayed one of my favorite <a href="http://xkcd.com/224/">xkcd comics</a> for us to enjoy.</p>
<p>There are so many <s>holy wars</s> debates about whether one language is better than another.  Instead, the right question to ask is whether or not the developer&#8217;s skill set is right for the job.  I agree.  When I look for a developer, I&#8217;m more concerned with how they think than in what language they think.</p>
<p>Unfortunately, Tim is preaching to the converted in this talk.  Nearly the entire attendance already uses Perl and don&#8217;t believe the myths.  With that, let&#8217;s conquer them anyway.</p>
<p><b>Perl is Dead</b></p>
<p>No it isn&#8217;t.  It&#8217;s two decades old and still growing strong.  The books aren&#8217;t flying off the presses with great speed because the Perl community already has excellent books.</p>
<p>The trend when searching for &#8220;web development&#8221; jobs shows Perl growing very slowly in relation to other languages, particularly PHP.  However, searching for &#8220;developer&#8221; jobs shows Perl growing very strongly and holding its own extremely well.</p>
<p>As a lurking member of the Perl community and an active member of my <a href="http://sandiego.pm.org/">local Perl Mongers group</a>, it&#8217;s been my experience that Perl programmers tend to be quite happy with their jobs.  Which, unfortunately, has made it very difficult for me to find talent.</p>
<p>In fact, Perl is growing faster than ever.  A simple look at how much work is going into CPAN will show that.  The community is strong and Perl is everywhere.</p>
<p><b>Perl Is Hard to Read / Test / Maintain</b></p>
<p>Only if you&#8217;re doing it wrongly.  We have <a href="http://oreilly.com/catalog/9780596001735/">Perl Best Practices</a>, to use as the default documentation for coding standards, leaving developers with the need to only document when they deviate from the norm.  There&#8217;s <a href="http://search.cpan.org/dist/Perl-Tidy/">Perl::Tidy</a>, to force any Perl code into one&#8217;s own personal style.  <a href="http://search.cpan.org/dist/Perl-Critic/">Perl::Critic</a> for ensuring that code is being well-written and follows best practices.  And there&#8217;s no end to the Test::* modules and the work being done to make testing easy.  There&#8217;s even a <a href="http://search.cpan.org/dist/Devel-Cover/">coverage analysis tool</a>.</p>
<p><b>Perl 6 is Killing Perl 5</b></p>
<p>In fact, Perl 6 saved Perl 5, but one has to be close to the center of the community to see that.  One should notice that Perl 5.8 and 5.10 have both been released in the time that Perl 6 has been in development.</p>
<p>There is a culture of testing around Perl.  So many tests have been written for Perl 6, and the language is being defined by its test suite.  This culture has leaked out to the community.  In fact, I find there now exists a lot of peer pressure in the community to do proper testing.</p>
<p><b>Perl 6 Is Not Perl</b></p>
<p>Yes, and no.  Unfortunately, I was so busy trying to catch up with the last section that I missed most of the points Tim made.  In the end, I feel that this is fine.  If Perl 6 was supposed to be Perl 5, why not just use the perfectly decent, already existing Perl 5?  Which is still being actively developed.</p>
<p><b>Perl 6 Will Never Be Ready</b></p>
<p>It&#8217;s not on a schedule and, if it were on a schedule, it would be crap.  It will be ready when it&#8217;s ready.  Better to do it right than screw it up.  The development model encourages a lot of experimentation, and it&#8217;s difficult to schedule experimentation.</p>
<p><b>There&#8217;s No Perl 6 Code</b></p>
<p>Sure there is.  Thousands of lines of Perl 6 code exist in the test suite that came about from Pugs.  These very same tests are being used in Perl 6 development today in the form of Rakudo, Perl 6 on Parrot.</p>
<p>The important thing to note is that Perl 6 refers to a specification.  It does not refer to a particular implementation.  Any implementation that passes the test suite may call itself Perl 6.</p>
<p>From an authority in the audience (who I don&#8217;t recognize, unfortunately), we have been told that there will be a useable Perl 6 by this Christmas.  A round of applause ensued.</p>
<p>[tags]oscon, oscon08, oscon2008, Perl, Tim Bunce, myths[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2008-perl-and-parrot/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OSCON 2008: State of the Onion</title>
		<link>http://sirhc.us/oscon-2008-state-of-the-onion/</link>
		<comments>http://sirhc.us/oscon-2008-state-of-the-onion/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 02:07:55 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Larry Wall]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon08]]></category>
		<category><![CDATA[oscon2008]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[State of the Onion]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=264</guid>
		<description><![CDATA[It&#8217;s finally time for the State of the Onion. Larry Wall introduced this year&#8217;s theme, Rules That Are Meant to be Broken. If he had Perl to do all over again, what would he do different? Only two things, nothing, &#8230; <a href="http://sirhc.us/oscon-2008-state-of-the-onion/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s finally time for the <a href="http://en.oreilly.com/oscon2008/public/schedule/detail/4871">State of the Onion</a>.  Larry Wall introduced this year&#8217;s theme, <i>Rules That Are Meant to be Broken</i>.</p>
<p>If he had Perl to do all over again, what would he do different?  Only two things, nothing, and everything.  Perl 6 is the everything part of the answer.</p>
<p>In Perl 5, one of the problems that creeps up is that regular expressions (regexes) are strings.  The best example of this is variable interpolation in regexes.  In Perl 6, this has been fixed.  They are now their own language.</p>
<p>Like cargo-cult programming, parsing has turned into its own cargo-cult.  Perl 6 breaks the mold when it comes to copying languages (the old lex/yacc loop), and instead uses polymorphism in its sub-language design.</p>
<p>Both regexes, double quoted strings, and single quoted strings are examples of sub-languages in Perl 6.  Each of these sub-languages has its own parsing rules and therefore parsing implementations.  This allows is code reuse.  Parsers can derive behavior from other parsers, but treat the tokens differently as necessary.</p>
<p>Fundamentally, Perl 6 is very simple.  It has no <code>CORE</code>.  It has no built-ins and no operators.  What Perl 6 has given us (will give us?), in effect, is a just in time lexer.  Tokens and their behavior can be defined on the fly, on a per-sub-language basis.</p>
<p>There are quite a few changes to the regularity of regular expressions.  Mostly what this means is that Perl 6 regexes are incompatible with those used in Perl 5, and that Perl-compatible regular expressions (PCRE) aren&#8217;t (or won&#8217;t be).</p>
<p>All languages tend to fall into the One True Syntax trap.  Perl 6 has aimed to break out of that trap.  By giving the user enough power over the syntax (rope) to design the language that suits them (hang themselves).</p>
<p>I didn&#8217;t enjoy the State of the Onion as much as I have in the past.  I suppose that&#8217;s to be expected.  Larry did warn us at the top of the talk that it would be serious and contain only a single joke.  For as great a writer as Larry is, his ability as a public speaker is lacking.  That&#8217;s okay, though.  I&#8217;d rather he not shift focus away from the design and development of Perl.</p>
<p>[tags]oscon, oscon08, oscon2008, Perl, State of the Onion, Larry Wall[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2008-state-of-the-onion/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OSCON 2008: Perl Lightning Talks</title>
		<link>http://sirhc.us/oscon-2008-perl-lightning-talks/</link>
		<comments>http://sirhc.us/oscon-2008-perl-lightning-talks/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 01:03:22 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Lightning Talks]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon08]]></category>
		<category><![CDATA[oscon2008]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=261</guid>
		<description><![CDATA[It&#8217;s 4:30pm on Thursday and that means it&#8217;s time for the Perl Lightning Talks. The crowd is excitedly gathering, but there are still plenty of seats as I write this. Sorry guys, these are five minute talks. If I start &#8230; <a href="http://sirhc.us/oscon-2008-perl-lightning-talks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s 4:30pm on Thursday and that means it&#8217;s time for the <a href="http://en.oreilly.com/oscon2008/public/schedule/detail/2501">Perl Lightning Talks</a>.  The crowd is excitedly gathering, but there are still plenty of seats as I write this.</p>
<p>Sorry guys, these are five minute talks.  If I start summarizing, I&#8217;ll fall way behind.  You&#8217;re lucky I even take the time to write this.</p>
<p>If you really want to know what&#8217;s going on, there&#8217;s a <a href="http://www.justanotherperlhacker.org/lightning/2008oscon.shtml">schedule</a>.</p>
<p>For those of you still reading, here&#8217;s a bit of stream-of-consciousness for you.  Note, if trying to match these up to the schedule, they are in order, but I didn&#8217;t comment on all of them.</p>
<hr />
<p><a href="http://pgfoundry.org/projects/pgtap/">Testing databases with TAP</a> is cool.  You really can test anything with it.</p>
<hr />
<p>Nice to see The Perl Foundation get some slots in Google&#8217;s Summer of Code this year.</p>
<hr />
<p>It&#8217;s interesting to see how much Perl is used to compile USA Today every day.  Without Perl, it would be a very empty paper.  Though I&#8217;m not convinced the content would be much different.</p>
<hr />
<p>Schwern tells us that, in thirty years, time will wrap.</p>
<pre>
$time = 2**31 - 1;
print scalar gmtime $time;

<i>Tue Jan 19 03:14:07 2038</i>

$time = 2**31;
print scalar gmtime $time;

<i>Fri Dec 13 20:45:52 1901</i>
</pre>
<p>Wait, that&#8217;s not good.  But he&#8217;s fixed it.</p>
<hr />
<p>Sweet, <a href="http://code.google.com/p/perl-appengine/">Perl on Google App Engine</a>!</p>
<hr />
<p>Use <a href="http://search.cpan.org/dist/autodie/">autodie</a> instead of <a href="http://perldoc.perl.org/Fatal.html">Fatal</a>.  It&#8217;s better.</p>
<p>Also, <a href="http://use.perl.org/~pjf/">Paul Fenwick</a> is one of the best speakers I&#8217;ve seen in ages.  I hope he becomes an OSCON staple.</p>
<hr />
<p><i>F*ck, the F*cking thing is F*cked</i> had the best slides.</p>
<p><a href="http://ipv6experiment.com/">IPv6Experiment.com</a> (warning: there may be porn).</p>
<p>[tags]oscon, oscon08, oscon2008, Perl, lightning talks[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2008-perl-lightning-talks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSCON 2008: Ultimate Perl Code Profiling</title>
		<link>http://sirhc.us/oscon-2008-ultimate-perl-code-profiling/</link>
		<comments>http://sirhc.us/oscon-2008-ultimate-perl-code-profiling/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 21:35:14 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon08]]></category>
		<category><![CDATA[oscon2008]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[profiling]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=256</guid>
		<description><![CDATA[Lunch is over and I&#8217;m here to listen to Tim Bunce talk about Ultimate Perl Code Profiling with Devel::NYTProf. The Devel::DProf module is old and a waste of time and is broken. Stop using it. Take it out and shoot &#8230; <a href="http://sirhc.us/oscon-2008-ultimate-perl-code-profiling/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Lunch is over and I&#8217;m here to listen to Tim Bunce talk about <a href="http://en.oreilly.com/oscon2008/public/schedule/detail/2960">Ultimate Perl Code Profiling</a> with <a href="http://search.cpan.org/Devel-NYTProf/">Devel::NYTProf</a>.</p>
<p>The <a href="http://serch.cpan.org/Devel-DProf/">Devel::DProf</a> module is old and a waste of time and is broken.  Stop using it.  Take it out and shoot it.</p>
<p>The first obvious distinction between profilers is CPU time versus real time.  CPU time tends to be highly granular, but doesn&#8217;t include I/O, context switching, or other kinds of blocking.  That&#8217;s where real time comes in.  It&#8217;s far more useful in the real world.</p>
<p>Tim, as with many of us, is interested in line-based profiling.  It provides a high level of granularity  The total subroutine time is not always useful, particularly in larger subroutines.</p>
<p>The NYTProf module is exremely fast, discounting the time taken by profiling overhead, making it quite a bit more useful for real world analysis.  It also allows profile times per block, and can be aggregated up to the subroutine level.  It&#8217;s a module with dual profilers: line-based and subroutine-based.</p>
<p>It gets better, every location that calls the subroutine keeps separate track of the subroutine time.  This allows us to determine where the majority of the subroutine calls are coming from.  For control flow statements, the decision expression is not taken into account when profiling the block that is executed.  This is useful if the loop control itself takes time that should be discounted.</p>
<p>And that&#8217;s it for the description.  Now we have half an hour to play with it.</p>
<p>The HTML-based reporting is inspired by <a href="http://search.cpan.org/dist/">Devel::Cover</a>&#8216;s reporting.  Reported for each file are the number of statements executed, the time spent in the source file and the line, block, and subroutine reports.  The subroutine reports include the amount of time spent within the subroutine and the amount of time spent in other called subroutines.  The coloring of each line of the report&mdash;red, orange, yellow, and green&mdash;give a relative measure of deviation from the norm.  Very impressive.</p>
<p>Even more impressive, Devel::NYTProf is capable of reporting exactly what a subroutine reference is called, even when it&#8217;s an anonymous subroutine compiled within an <code>eval</code>.  With a handy link also provided, the called code can be easily inspected.</p>
<p>In summary, Devel::NYTProf is awesome.  Use it.  I know I will.</p>
<p>Tim Bunce is even more impressive than most people think he is.  He is the only presenter I&#8217;ve seen so far who has managed to use IRC while giving his talk.  Well, he didn&#8217;t actually type on IRC, but he had Colloquy running in the background.  This particular IRC client uses Apple&#8217;s Growl feature to display notifications when you are mentioned in a channel.  After he&#8217;s opened up the session to questions, one of those notifications pops up on the projected display:</p>
<blockquote><p>
&lt;sirhc&gt; Adam Kennedy (to Tim Bunce): Why are you so awesome?
</p></blockquote>
<p>It got a laugh, and Tim seemed to take it all in stride, even joking that he was not looking very professional on his screen cast.  Important safety tip for session presenters, don&#8217;t leave your IRC client open.</p>
<p>[tags]oscon, oscon08, oscon2008, Perl, programming, profiling[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2008-ultimate-perl-code-profiling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSCON 2008: Perl for Political Campaigns</title>
		<link>http://sirhc.us/oscon-2008-perl-for-political-campaigns/</link>
		<comments>http://sirhc.us/oscon-2008-perl-for-political-campaigns/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 21:12:35 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon08]]></category>
		<category><![CDATA[oscon2008]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[politics]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=254</guid>
		<description><![CDATA[There was nothing interesting for me scheduled for the second session today, so I ended up in Perl for Political Campaigns, presented by Chris &#8220;Pudge&#8221; Nandor. I&#8217;m not entirely sure why I&#8217;m here, but it likely has something to do &#8230; <a href="http://sirhc.us/oscon-2008-perl-for-political-campaigns/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There was nothing interesting for me scheduled for the second session today, so I ended up in <a href="http://en.oreilly.com/oscon2008/public/schedule/detail/2655">Perl for Political Campaigns</a>, presented by Chris &#8220;Pudge&#8221; Nandor.  I&#8217;m not entirely sure why I&#8217;m here, but it likely has something to do with Perl in the title and Pudge as the presenter.  I must be in the right place, though.  Both Damian Conway and Adam Kennedy are present.</p>
<p>Pudge is, quite famously, a Republican, so he wants poor people to die, he asserts his right to shoot people who jaywalk, and he hates puppies.  Now that we have that out of the way, this will not be a political talk.  Instead, it will be a talk that just happens to use politics as the problem domain for which Perl was the solution (but isn&#8217;t it always?).  Pudge happens to volunteer for the Republican party in Snohomish county, Washington.  I actually know the area fairly well, as my grandmother happens to live there.</p>
<p>Winning elections is all about knowledge.  And blackmail.  But, mostly knowledge.</p>
<p>This session is essentially about data mining.  There are a number of disparate data sources available with information about voters.  From registration and voting history to contact information and preferences&mdash;can or can they not be contacted.  This data is not always easy to access.  For example, there is something called the Voter Vault, which is a super secret database of voter information controlled by the Republican party (there&#8217;s an NDA involved, so we won&#8217;t see any of it).</p>
<p>Essentially, Voter Vault is a really crummy Web application that only works for IE (hence the crummy part).  That&#8217;s where <a href="http://search.cpan.org/dist/WWW-Mechanize/">WWW::Mechanize</a> comes in.  Using this brilliant module, data on any Web site can be retrieved, even if it requires a certain amount of user interaction to access.  This, along with other sites, like the Washington State Public Disclosure Commission, provide all the raw data Pudge needs.</p>
<p>However, raw data is, by itself, not useful to anyone.  This is the reason behind Pudge&#8217;s efforts.  He uses Perl (and some JavaScript) to collect and aggregate all of this data.  Then, once it&#8217;s all compiled, he can use a bit of Perl glue to use the data in Apple&#8217;s Address Book and Mail applications.  But, more importantly, he can visualize it.</p>
<p>For the visualization, Pudge uses everyone&#8217;s favorite new tool, Google Maps.  Using the Ajax API provided by Google, he can embed a map in his own Web application and, next to it, provide controls to enable and disable different views of the data on the map.  For example, candidate donations by city and how much each candidate received.</p>
<p>It gets better.  With the Google Earth APIs available to Google Maps, KML files can be generated (again, with Perl) to provide even better data visualizations.  For example, precinct boundaries can be imported and colored based on voting history.</p>
<p>Initially, I wasn&#8217;t sure how I&#8217;d feel about this talk, but I ended up enjoying it.  It was an excellent presentation on how to take data and display it to users in a useful manner.</p>
<p>[tags]oscon, oscon08, oscon2008, Perl, politics, visualization[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2008-perl-for-political-campaigns/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OSCON 2008: Stick a fork() in It</title>
		<link>http://sirhc.us/oscon-2008-stick-a-fork-in-it/</link>
		<comments>http://sirhc.us/oscon-2008-stick-a-fork-in-it/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 18:45:32 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon08]]></category>
		<category><![CDATA[oscon2008]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=251</guid>
		<description><![CDATA[First session of the day and I&#8217;m in room F150 (brought to you by Ford). The F wing, bereft of wifi. I&#8217;m here for Stick a fork() in It: Parallel and Distributed Perl with Eric Wilhelm of Scratch Computing. It&#8217;s &#8230; <a href="http://sirhc.us/oscon-2008-stick-a-fork-in-it/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>First session of the day and I&#8217;m in room F150 (brought to you by Ford).  The F wing, bereft of wifi.  I&#8217;m here for <a href="http://en.oreilly.com/oscon2008/public/schedule/detail/2748">Stick a fork() in It: Parallel and Distributed Perl</a> with Eric Wilhelm of <a href="http://scratchcomputing.com/">Scratch Computing</a>.  It&#8217;s great to see how popular Perl still is.  It&#8217;s standing room only in here.</p>
<p>A computer once referred to a human worker who would perform calculations.  This was a fairly easy thing to cluster and &#8220;run&#8221; several computers in parallel.  As time progressed, more and faster work was desired.  Enter the electronic computer, and specifically for this talk, the Cray.  As with anything, the inner workings of the Crays of old can be recreated in Perl.  Just use the Cray module, no problem (if only it existed).</p>
<p>After the history lesson, we move into high level overviews of parallelism and pipelineing, and a note about <a href="http://en.wikipedia.org/wiki/Amdahl%27s_law">Amdahl&#8217;s Law</a>.  This was followed up with an example for detecting prime numbers by partitioning the work.</p>
<p>The slide presentation was over in under 20 minutes.  Instead, we&#8217;re jumping straight into code examples.  Awesome.</p>
<p>Or so I thought.  Unfortunately, he&#8217;s been interrupted by multiple people in the audience, who keep wanting to move off into tangential conversations.  Eric is having difficulty bringing the talk under his own control&mdash;it&#8217;s no longer his talk, but that of the somewhat rude fellow in the front row.  Neither is Eric as eloquent when he switches from a prepared talk to demonstrating and explaining real code.  It&#8217;s become far more difficult to pay attention to this session, and I find myself looking at the clock to see how much time we have until the next session.</p>
<p>For real fun, be sure to check out <a href="http://www.canspice.org/">Brad&#8217;s</a> post on Schwern&#8217;s session about <a href="http://www.canspice.org/2008/07/24/oscon-2008-skimmable-code-by-michael-schwern/">skimmable code</a>.</p>
<p>[tags]oscon, oscon08, oscon2008, Perl, programming[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2008-stick-a-fork-in-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Ninja&#8221; Code</title>
		<link>http://sirhc.us/ninja-code/</link>
		<comments>http://sirhc.us/ninja-code/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 22:20:10 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon08]]></category>
		<category><![CDATA[oscon2008]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=227</guid>
		<description><![CDATA[The Amazon booth at OSCON 2008 is advertising heavily that they are hiring. They are also holding a raffle. To enter, simple look over some Perl code they have written out on some poster board and tell them what it &#8230; <a href="http://sirhc.us/ninja-code/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.amazon.com/">Amazon</a> booth at OSCON 2008 is advertising heavily that they are hiring.  They are also holding a raffle.  To enter, simple look over some Perl code they have written out on some poster board and tell them what it does.  It looks a little something like this (transcribing from memory):</p>
<pre>
my $code = qq{
    print 1+1 . "\n";
    $code =~ m/(\d+)\+(\d+)/;
    $new = $1 + $2;
    $code =~ s/\d+\+(\d+)/$2+$new/;
};

for ( 1 .. 10 ) {
    eval($code);
}
</pre>
<p>What&#8217;s the first bug?  Yes, it should use <code>q{}</code>, or the variables will interpolate on the initial assignment to <code>$code</code>.  To their credit, they initially used single quotes, but people said it was too hard to read.</p>
<p>I wasn&#8217;t content with just figuring out what the code did and fixing a small bug.  I think it can be written better.</p>
<pre>
eval($code = q{
    print 1+1 . "\n";
    $code =~ s/(\d+)(\+)(\d+)/"$3$2" . ($1 + $3)/e;
    eval $code;
});
</pre>
<p>Much better.  Not only is it more concise, I was able to remove that pesky loop, so I wouldn&#8217;t be bothered by any silly upper bounds.</p>
<p>So what does it do?  Should be obvious.  Head over to the Amazon booth and let them know.</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/ninja-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OSCON 2008: Strawberry Perl: Achieving Win32 Platform Equality</title>
		<link>http://sirhc.us/oscon-2008-strawberry-perl-achieving-win32-platform-equality/</link>
		<comments>http://sirhc.us/oscon-2008-strawberry-perl-achieving-win32-platform-equality/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 18:27:59 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Adam Kennedy]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon08]]></category>
		<category><![CDATA[oscon2008]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Strawberry Perl]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=217</guid>
		<description><![CDATA[My first session of the day is Strawberry Perl: Achieving Win32 Platform Equality, presented by Adam Kennedy. Originally, I had considered a Parrot talk, but I saw a similar talk at SCALE6x, and I happened upon Adam on IRC this &#8230; <a href="http://sirhc.us/oscon-2008-strawberry-perl-achieving-win32-platform-equality/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My first session of the day is <a href="http://en.oreilly.com/oscon2008/public/schedule/detail/2769">Strawberry Perl: Achieving Win32 Platform Equality</a>, presented by <a href="http://search.cpan.org/~adamk/">Adam Kennedy</a>.  Originally, I had considered a Parrot talk, but I saw a similar talk at <a href="http://sirhc.us/journal/2008/02/10/scale-6x-programming-parrot/">SCALE6x</a>, and I happened upon Adam on IRC this morning.  I chatted briefly with him about his talk, and he happens to be in communication with a <a href="http://www.antlinux.com/">friend of mine</a>, who is working on <a href="http://code.google.com/p/camelbox/">Camelbox</a>, a Windows build of Perl originally targeted as a way to easily distribute applications written with Gtk front ends (I hope I got the motivation correct).</p>
<p>Recently, Adam has been funded by The Perl Foundation, Perl in Israel, and Stonehenge to use Perl from nothing but his flash drive.  This provides an excellent motivation to get Strawberry Perl working in a highly portable way.</p>
<p>Originally, Perl was awesome and worked everywhere&mdash;except Windows.  That was okay, because Windows didn&#8217;t matter.  No one did any real work on Windows.  Then, around 1995, Windows started to matter.  A brief history of Perl on Windows followed, resulting in what is today <a href="http://www.activestate.com">ActiveState</a>.</p>
<p>Much of what Adam wrote for <a href="http://search.cpan.org/dist/PPI/">PPI</a> does not work in ActivePerl, which makes it a non-starter for him, as he tends to work on Windows.  Anything depending on Scalar::Util or List::MoreUtils modules will not work with the ActivePerl build system.  This led to an embarrassing problem for Adam when he gave a talk three years ago at OSCON.  He couldn&#8217;t give his demo, because PPI would not build in ActivePerl.  In fact, ActiveState&#8217;s package manager has gotten so much worse that almost any module that is at all useful does not exist&mdash;and thus nothing useful can be done on Windows (big surprise).</p>
<p>Moving away from ActiveState, this talk is essentially about Adam trying to get his own laptop to work.  That&#8217;s really all he wants.  It&#8217;s a modest desire.  More importantly, the <a href="http://search.cpan.org/dist/CPAN/">CPAN</a> module has to work.  Without that, what&#8217;s the use of Perl?</p>
<p>So Adam offered a prize: a yard-high stack of cases of any beer desired by the first person who could provide a fully-installable and working (by the above definition of working) version of Perl for Windows.  After six months and no sign of a winner, he changed the prize to &#8220;craploads&#8221; of beer.  In 24 hours, he received two entries.  The winner cheated a lot, but the loser was <a href="http://vanillaperl.com/">Vanilla Perl</a>, which has become a testing ground for experimentation.</p>
<p><a href="http://strawberryperl.com/">Strawberry Perl</a> is the Perl for Windows designed for people who don&#8217;t use Windows.  That is, the people who do all of their work on Unix or Unix-like systems&mdash;Linux, Solaris, and Mac OS X.  The main goal of the project is to make it <i>easy</i>&mdash;it is Perl, after all.</p>
<p>In the future will come Chocolate Perl&mdash;completing the holy trinity of neopolitan flavors&mdash;for people who know Windows, but don&#8217;t know Perl, and thus the Unix-like characteristics of Perl.</p>
<p>The target of Adam&#8217;s financial support is Portable Perl: Perl for flash drives.  Carry it around, install CPAN modules onto, or from, the flash drive.  It&#8217;s network-aware, does the right thing, and juliennes fries.  An excellent standard being developed for portable apps is, in fact, <a href="http://portableapps.com">PortableApps.com</a>, where applications such as Firefox or Putty can be downloaded and installed to those ever-growing flash drives.</p>
<p>Available Thursday at the <a href="http://www.perlfoundation.org/">Perl Foundation</a>&#8216;s booth in the expo hall will be branded flash drives with Portable Perl on them.  At least, I think I heard that correctly.</p>
<p>I really like the work Adam is doing.  He&#8217;s accomplished so much to get Perl everywhere.  That&#8217;s a cause I can get behind.</p>
<blockquote><p>
&#8220;The main problem today is Vista.&#8221;<br />
&mdash; Adam Kennedy
</p></blockquote>
<p>Okay, I took that out of context, but I couldn&#8217;t resist capturing the quote.  What he really means is that changes made to Windows in Vista have made things not work, in particular the access control.  It&#8217;s not an unusual problem when upgrading to new systems, but it is more difficult with proprietary platforms, which Open Source authors have very little access to.</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2008-strawberry-perl-achieving-win32-platform-equality/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>OSCON 2008: Perl Worst Practices</title>
		<link>http://sirhc.us/oscon-2008-perl-worst-practices/</link>
		<comments>http://sirhc.us/oscon-2008-perl-worst-practices/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 18:36:52 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[clever]]></category>
		<category><![CDATA[Damian Conway]]></category>
		<category><![CDATA[obfuscation]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon08]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=198</guid>
		<description><![CDATA[I&#8217;m sitting in Portland 252 for my first tutorial of the day, Perl Worst Practices with Damian Conway. He&#8217;s started off by complimenting us on our intelligence and our ability to convince our bosses or significant others that paying for &#8230; <a href="http://sirhc.us/oscon-2008-perl-worst-practices/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sitting in Portland 252 for my first tutorial of the day, Perl Worst Practices with Damian Conway.  He&#8217;s started off by complimenting us on our intelligence and our ability to convince our bosses or significant others that paying for a worst practices course was a good idea.</p>
<p>Most of us are, of course, aware of the concept of best practice when coding.  Writing code that&#8217;s maintainable, predictable, and follows the rules.  Oh, and uses Java.</p>
<p>Worst practice is, by contrast, code that is obfuscated, unmaintainable, and breaks all of the rules.  Today, we will be studying code that Damian has submitted to the Obfuscated Perl contest.  This promises to be very, very scary.</p>
<p>Damian&#8217;s entry to this contest was <a href="http://www.perlfoundation.org/perl5/index.cgi?selfgol">SelfGOL</a>, a program capable of self-replication, rewriting other Perl programs to themselves self-replicate, detecting un-rewritable programs, playing Conway&#8217;s &#8220;Game of Life,&#8221; and, as if that wasn&#8217;t enough, animating any text as a cycling marquee banner.  The main constraint of the contest is that the entry must be under 1,000 bytes of code, so it shouldn&#8217;t be too difficult to understand.  Obviously it doesn&#8217;t use any modules, because that would be too easy.  Not only that, but it doesn&#8217;t use a single control structure.  This is going to be great.</p>
<p>Following an amusing demonstration of SelfGOL, we moved into treating it as a case study for a set of principles.  Principles that will focus on the very practices SelfGOL embodies, and why they should never, ever be used.  As I intend to enjoy the discussion, I won&#8217;t spend much time writing about the discussion and examples accompanying these principles, but rather simply note the principles for my own benefit (documentation for the win).  After all, sharing all my new tips and tricks would suck all the fun out of it.</p>
<p>Principle 1: Sane and consistent layout makes code more maintainable (but it isn&#8217;t a magic bullet if the code itself is beyond help).</p>
<p>Principle 2: Using built-in features isn&#8217;t necessarily smarter or cleaner (even though fellow developers&#8217; futile struggles to recall those features can be highly amusing).</p>
<p>Principle 3: Obscure obsolete features are obscure and obsolete for a reason (and restasking them for even more obscure purposes is not helping).</p>
<p>Principle 4: Each statement should do one thing only (since that&#8217;s the upper limit most brains can comprehend).</p>
<p>Principle 5: Relying on default behavior makes code very slightly easier to write and vastly harder to read (because most readers can see better than they can think).</p>
<p>Principle 6: Randomly placed subroutine definitionss are static (in the radio interference sense).</p>
<p>Principle 7: Choose data structures that simplify your task (even if the task is to make those data structures incomprehensible).</p>
<p>Principle 8: Just because you use some operation frequently doesn&#8217;t mean it should be in a utility function (especially if it&#8217;s in a function merely to abbreviate its name).</p>
<p>Principle 9: Encapsulating the familiar can decrease maintainability (refactoring isn&#8217;t a substitute for sanity).</p>
<p>Principle 10: Treat any clever one-line solution as an alarm bell (or as an antipersonnel mine with a six-month delay fuse).</p>
<p>Principle 11: Familiarity breeds comprehension (it breeds contempt (but hey, what&#8217; doesn&#8217;t?)).</p>
<p>Principle 12: Table-driven solutions are clean, efficient, and extensible (as long as you don&#8217;t mind losing a little comprehensibility).</p>
<p>Principle 13: Building a messy data structure and then cleaning it up is often easier than building it cleanly in the first place (and to hell with the purists).</p>
<p>Principle 14: Some code is better compiled at run-time (but the urge to use <tt>eval</tt> is Nature&#8217;s way of letting you know there&#8217;s not yet enough pain or misey in your life).</p>
<p>Principle 15: Parentheses are our friends (cos, if you can remember all 24 levels of Perl&#8217;s precedence, you gotta get a life, dude!).</p>
<p>Principle 16: Edge cases suck (and edge cases of familiar constructs suck worst of all).</p>
<p>Principle 17: Code should do what it seems to be doing (especially when it seems to be doing something subtle).</p>
<p>Principle 18: Conceptual elegance is no guarantee of actual maintainability (nor a good substitute for it).</p>
<p>Principle 19: If you&#8217;re going to have default values, define them near the place they may actually be used (or, at least, somewhere they have a slim chance of being discovered).</p>
<p>Principle 20: No matter how good you think your error messages are, they&#8217;re still too brief, too obscure, and too hard to decipher (even if you&#8217;ve already taken Principle 20 into account).</p>
<p>Principle 21: Avoid using obsolete and arcane magic punctuation variables with unfamiliar default values and unexpected global effects (even if you happen to enjoy a little self-inflicted pain in other recreational activities).</p>
<p>Principle 22: The fundamental complexity of any problem is irreducible (optimizations merely redistribute the pain differently).</p>
<p>Principle 23: Code that breaks when it&#8217;s reformatted is already broken (though on a much more profound and interesting level).</p>
<p>Principle 24: If it&#8217;s impossible to understand, it&#8217;ll be impossible to maintain (on the bright side, of course, such code is highly stable).</p>
<p>This last one should, but often doesn&#8217;t, go without saying.</p>
<p>Principle 25: Phenomimetic retrodeterministic nominativism generally does not improve code comprehension (then again, did it sound like it would?).</p>
<p>Principle 26: Don&#8217;t allow dynamic behavior to violate static expectations (and the easiest way to do that is reusing over-scoped variables for unrelated purposes).</p>
<p>Principle 27: Explicit behaviors are better than implicit behaviors (especially when the specification of the implicit behavior is syntactically baroque and hard-to-spot, and the behavior itself is unknown to the majority of developers).</p>
<p>At this late point of the tutorial, <a href="http://www.canspice.org/">Brad</a> pointed out to me that all of these principles are in the included materials.  Now that I&#8217;ve already transcribed so much from the slides, I don&#8217;t have the heart to delete it all.  Of course, since I haven&#8217;t been commenting on all of the black magic to this point, there would then be very little in the end to post.  Brad also has a much better <a href="http://www.canspice.org/2008/07/22/oscon-2008-perl-worst-practices-by-damian-conway/">post</a> about this tutorial, since he actually took real notes.</p>
<p>Principle 28: Code that pre-caches or precomputes its data is much easier to maintain than code that caches or computes on-the-fly (when you&#8217;re running at multiple gigahertz, acquiring your data a few thousand operations early is still plenty JIT enough).</p>
<p>Principle 29: Coding is an art, but code shouldn&#8217;t be art (evolution made programmers boring, pedestrian, and aesthetically challenged for good reasons).</p>
<p>It&#8217;s mesmerizing to listen to the thought process behind Damian&#8217;s obfuscated code.  I can&#8217;t help but wonder if this well-organized, well-thought-out explanation is anything close to how Damian designed this program.  Or, rather, if there are extremely convoluted, scary, and most importantly, evil gears grinding away inside his head.  In fact, I suspect this entire tutorial may have been designed purely as a way of documenting SelfGOL so Damian himself can remember how it works.  Clever.</p>
<p>This kind of programming is silly and fun, but it serves a real purpose.  Pushing the limits of a language teaches about its dark places.  The understanding that comes from it vastly improves the skills of the programmer, even if&mdash;especially if&mdash;the bad things are never, ever used.  Perl, even more than other languages, encourages this kind of play, thanks to its rich diversity and culture.</p>
<p>Important safety tip: keep these tricks and contrivances for recreational purposes only.</p>
<p>I don&#8217;t know what&#8217;s more disturbing, how much of the tutorial I understood, or how much I already knew coming in.</p>
<p>[tags]oscon, oscon08, Perl, Damian Conway[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2008-perl-worst-practices/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>OSCON 2008: Perl Security</title>
		<link>http://sirhc.us/oscon-2008-perl-security/</link>
		<comments>http://sirhc.us/oscon-2008-perl-security/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 23:38:39 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon08]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=181</guid>
		<description><![CDATA[After lunch, I wandered over to Portland 255 with Brad and Al for the Perl Security tutorial, presented by Paul Fenwick. Straight away I can tell that he&#8217;s going to be a lively and entertaining presenter. His slides go by &#8230; <a href="http://sirhc.us/oscon-2008-perl-security/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After lunch, I wandered over to Portland 255 with <a href="http://www.canspice.org/">Brad</a> and <a href="http://www.dailyack.com/">Al</a> for the <a href="http://en.oreilly.com/oscon2008/public/schedule/detail/3049">Perl Security</a> tutorial, presented by <a href="http://use.perl.org/~pjf">Paul Fenwick</a>.  Straight away I can tell that he&#8217;s going to be a lively and entertaining presenter.  His slides go by quickly, as they are merely short counterpoints to his commentary.  His commentary, which is also very quick and slightly witty.  I don&#8217;t expect to have any trouble paying attention.  If anything, I&#8217;m worried that I&#8217;ll fail to pay attention to my writing and, of course, to the #oscon IRC channel.</p>
<blockquote><p>
&#8220;A computer is secure if you can depend on it and its software to behave as you expect.&#8221;<br />
&mdash;Simson Garfinkel and Gene Spafford in Practical UNIX &#038; Internet Security
</p></blockquote>
<p>In a nutshell, that&#8217;s what security is.  If a computer behaves as expected, it is secure.  That is, unless it&#8217;s expected to be insecure, I suppose.  I&#8217;m not sure I&#8217;d enjoy that situation, so I&#8217;ll assume the assumption of expected behavior is both expected and secure.</p>
<p>Most security boils down to common sense.  Unfortunately, this mythical state of being is far less common than its name would imply.  Sad, but true.  People are often lazy or distracted, and these usually lead to really stupid mistakes.</p>
<p>There is a key acronym when thinking about security: <a href="http://www.cia.gov/">CIA</a>.  No, not that CIA.  Yes, I thought so, too, at first.  What it really means is, Confidentiality, Integrity, and Accessibility.  Confidentiality, because information will not remain secure if it does not remain confidential.  Integrity, because information must remain known and trusted to remain secure.  Accessibility, because denial of access to information may result in insecurity.  I may not have done justice to this acronym, because the tutorial moved on quickly after this point.  I&#8217;m sure there are <a href="http://en.wikipedia.org/wiki/Information_security">web sites</a> dedicated to security that can better define the term.</p>
<p>Perhaps the most important piece of advice for the unwitting Perl programmer is to always perform data validation.  Never, ever trust input, <i>regardless</i> of where it came from.  Fortunately, Perl provides Taint Mode, which forces the program to mistrust input.</p>
<p>Paul shared with us a variety of examples to demonstrate why input should not be trusted, as well as a number of examples of how to properly untaint data.  As with anything, it&#8217;s easy to become lazy when untainting data, which can sometimes be as bad as not using Taint Mode at all.</p>
<p>The tutorial continued into what is essentially a list of best practices to follow when programming securely with files.</p>
<ul>
<li>Do: Use the three argument version of <tt>open()</tt>, to prevent attacks using file names with magic characters in them.</li>
<li>Do: Use <tt>sysopen()</tt> instead of <tt>open()</tt>, which provides ways to avoid overwriting a file, thus helping to prevent symlink attacks often as a result of race conditions.</li>
</ul>
<p>The common attack vector in so many of the examples given so far has been via file names.  Wouldn&#8217;t it be great if we could write programs without file names at all?  Well, when working in a Unix-like environment, we can.  Perl has the ability to use anonymous files by passing <tt>undef</tt> as the third argument to <tt>open()</tt>.  He was even kind enough to provide us with a way of passing these anonymous file handles to child processes, by disabling the close-on-exec flag prior to calling <tt>system()</tt>.  Sorry, the slide went by too quickly for me to transcribe the method.  It, along with all the other examples, are available <a href="http://perltraining.com.au/notes.html">online</a>.</p>
<p>Calling <tt>system()</tt> and using backticks make Paul really, really angry.  Why?  Because doing it right is hard.  In fact, just correctly checking the result in <tt>$?</tt> requires 10 lines of code, according to the documentation for <tt>system()</tt> in the <a href="http://perldoc.perl.org/perlfunc.html">perlfunc</a> manual page.  So, 10 lines just to verify that a single line of code executed successfully.</p>
<p>I briefly became distracted by news of a <a href="http://sirhc.us/journal/2008/07/21/fire-in-encinitas/">fire</a> back home.  However, what I was able to get is that Paul has written a module, <a href="http://search.cpan.org/dist/IPC-System-Simple/">IPC::System::Simple</a>, which, as the name implies, makes the process of calling system commands quite simple.</p>
<p>After the mid-afternoon break, we ventured into setuid and setgid programs.  Perl provides ways to determine who is really running the program (<tt>$&lt;</tt>, <tt>$(</tt>) and who is effectively running the program (<tt>$&gt;</tt>, <tt>$)</tt>).  Perl is, however, ignorant of the saved UID, which is the third UID in Unix, along with real and effective.  Unfortunately, the standard for setuid scripts is confusing and implemented differently on various systems, so don&#8217;t use it.  Really.</p>
<p>Even worse, the <tt>$&lt;</tt> and <tt>$&gt;</tt> variables are cached by Perl, so they may lie to the program, especially when using the <tt>setresuid()</tt> system call to properly drop privileges, as recommended.  Fortunately, another useful module from Paul, <a href="http://search.cpan.org/dist/Proc-UID/">Proc::UID</a> provides a solution to this caching problem.</p>
<p>Now we move into DBI security.  <a href="http://en.wikipedia.org/wiki/SQL_injection">SQL injection attacks</a> are very similar to the file name or shell attacks covered previously.  Any database programmer worth his salt should be aware of the hazards of composing SQL, so I won&#8217;t go into the examples here.  Programmers should, of course, use placeholders if they&#8217;re available.  The DBI module itself provides its own Taint Mode, both for input and output, adding all the benefits of Perl Taint Mode to database interface code.  Even better, it can be controlled on a per-statement basis.</p>
<p>All of this careful taint checking we&#8217;ve done and Perl may end up sabotaging us anyway.  When presented with files on the command line, Perl is happy to just open them using the simplistic, dangerous, single argument <tt>open()</tt> call.  Typically, this is done when using the <tt>&lt;&gt;</tt> operator in a <tt>while</tt> loop.  Also, everyone forgets to use Taint Mode in cron jobs.  Don&#8217;t do that.  Really.</p>
<p>Because Perl is written in C, the null byte becomes very interesting.  While it is a perfectly valid character in Perl strings, it marks the end of a C string.  In most circumstances, this is not a problem.  However, it can mean bad things when making systems calls, which are written in C.  Normally, at a terminal, null bytes don&#8217;t occur in user input, unless that input comes from the Web.  Null bytes can be trivially represented by the %00 escape sequence.</p>
<p>I need to go through the list of Paul&#8217;s <a href="http://search.cpan.org/~pjf/">modules</a>, since they appear to be ideal for the type of programming I tend to do, as an IT developer.  In fact, he&#8217;d like to see some Solaris patches for Proc::UID, so I can probably help him with that.</p>
<p>I noticed during the tutorial that Paul must read the <a href="http://failblog.org/">Fail Blog</a> and <a href="http://icanhascheezburger.com/">I Can Has Cheezburger</a>, or at least knows someone who does.  Quite a few of the images that have appeared on his slides have graced the pages of those web sites.</p>
<p>As an added bonus, the tutorial ended 40 minutes early, and Paul had bonus material.  What a guy.</p>
<p>The tutorial, and with it the day, is now over.  It&#8217;s time for dinner, then maybe a <a href="http://en.wikipedia.org/wiki/Birds_of_a_Feather_%28computing%29">BOF</a> session or maybe just a trip to a pub.</p>
<p>[tags]oscon, oscon08, perl, security[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2008-perl-security/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>OSCON 2008: Mastering Perl</title>
		<link>http://sirhc.us/oscon-2008-mastering-perl/</link>
		<comments>http://sirhc.us/oscon-2008-mastering-perl/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 18:56:49 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[OSCON]]></category>
		<category><![CDATA[oscon08]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=177</guid>
		<description><![CDATA[It&#8217;s early on Monday morning and I&#8217;m in my first tutorial session of the day, following the continental breakfast provided in Convention Hall E. I wasn&#8217;t overly impressed with the tutorial options this year. So, being who I am, I &#8230; <a href="http://sirhc.us/oscon-2008-mastering-perl/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s early on Monday morning and I&#8217;m in my first tutorial session of the day, following the continental breakfast provided in Convention Hall E.  I wasn&#8217;t overly impressed with the tutorial options this year.  So, being who I am, I mostly opted for the Perl track.  That brings me to where I sit now: D136, listening to <a href="http://www252.pair.com/comdog/">brian d foy</a> teach us about <a href="http://www252.pair.com/comdog/mastering_perl/">Mastering Perl</a>.  I almost didn&#8217;t attend this tutorial, since I&#8217;ve read the book and, while I found it excellent, I learned very little from it.  I took this to mean that I&#8217;ve already mastered Perl.  But, like I said, my options are limited&mdash;I&#8217;m not very interested in the introductory Python tutorial.</p>
<p>The idea behind Mastering Perl is not to talk about Perl to a group of Perl masters.  Instead, it&#8217;s about mastering Perl in the guild sense (and not of the <a href="http://en.wikipedia.org/wiki/Society_for_Creative_Anachronism">SCA</a> variety).  Back in the day, and still existing in some professions today, there was an apprentice system.  A neophyte&mdash;in today&#8217;s nomenclature, a noob&mdash;would begin acquiring skills under a master of the art.  As he progressed, he would be entrusted with more and more responsibility, until finally he became a master himself and took people under his own wings.</p>
<p>This <a href="http://en.wikipedia.org/wiki/Apprenticeship">apprenticeship</a> system, somewhat unfortunately, does not exist in the computing world.  That&#8217;s where brian d foy feels that <i>Mastering Perl</i> fits.  Lacking true masters, the book acts as a substitute.  Someday, we may even create a guild system.  But then we&#8217;d probably have to pay dues and follow rules, and that&#8217;s not very attractive.  That said, it&#8217;s the model I&#8217;m hoping to use at my own place of work.  I&#8217;d like to hire one or two developers who I can take under my own wing and mentor them in the ways of Perl and the grid.</p>
<p>The first two topics covered are tools for optimization, profiling and benchmarking.  Often mis-attributed to Donald Knuth, Tony Hoare once said, &#8220;Premature optimization is the root of all evil.&#8221;  What this means is that one should never assume what requires optimization.  Let the testing be the guide.</p>
<p>While profiling is objective, benchmarks, like statistics, are not always objective.  Everyone has an agenda and benchmarks are subjective.  Often, benchmarks are short-sighted.  For example, benchmarking code run time and attempting to optimize for it may not be worth the expense of the developer time required to make the requisite changes.  It&#8217;s worth analysing what is important before blindly following benchmarks.</p>
<p>I&#8217;ve been on the receiving end of misplaced premature optimization.  I worked with a development group that put far too much emphasis on achieving perfect results on their <a href="http://search.cpan.org/dist/Devel-Cover/">Devel::Cover</a> reports.  This led to strange bugs in their code, and a strong belief that &#8220;<a href="http://use.perl.org/~cgrau/journal/33924"><tt>new()</tt> doesn&#8217;t work that way</a>.&#8221;  As it turns out, their test suite was calling <tt>new()</tt> in two ways.  I forget what the second method was, but it was not used anywhere else in their code.  However, in order to get this test code to run, and get 100% coverage, they added code to the constructor for every class.  Code that prevented inheritance of the method.  The team then convinced themselves that constructors could not be inherited in Perl, rather than realizing that their own habits were the problem.</p>
<p>After the mid-morning break, we wrapped up the discussion on profiling and benchmarking, and moved into configuration.  This is a vital topic for anyone who desires the ability to pass a program off to users without being bothered to modify it later in response to users&#8217; desire to customize the program for a slightly different use.</p>
<p>External configuration, particularly via the command line, is something I depend on heavily, even in very simple Perl or Bourne shell scripts.  I almost always create command line options for performing a dry run or output debugging information.  Not only are these useful for development, they can live on in the final program, providing help to the final user, who more often than not is me.  Sometimes I will even add configuration to values that never change, just for when they eventually do.</p>
<p>Jumping past configuration, we move on to logging.  It&#8217;s really easy to add to a program, and it&#8217;s really useful to leave in a program when it&#8217;s released.  The ability to enable logging on the fly sure beats adding a bunch of <tt>print()</tt> calls in the code when it inevitably breaks at three in the morning.  The <a href="http://search.cpan.org/dist/Log-Log4perl/">Log::Log4perl</a> module is a particularly powerful method of adding logging to programs.  It&#8217;s well worth investigating for anyone who wants to easily add logging functionality to their code.</p>
<p>The final topic of the day is lightweight persistence.  It&#8217;s always nice to have data stick around between program invocations.  The easy way (and everything in the second half of the tutorial is easy) to add persistence to code is to not use DBI.  While DBI is powerful, it also tends to require a database server (ignoring SQLite for the moment).  Modules such as <a href="http://search.cpan.org/dist/Data-Dumper/">Data::Dumper</a>, <a href="http://search.cpan.org/dist/YAML/">YAML</a> or <a href="http://search.cpan.org/dist/Storable/">Storable</a> are ideal for easily storing and retrieving data in code.</p>
<p>After the tutorial, brian will be available at the <a href="http://www.powells.com/">Powell&#8217;s Books</a> mini store, located near the registration desk, to sign copies of <i>Mastering Perl</i>.  I already have a copy, thanks to my local <a href="http://sandiego.pm.org/">Perl Mongers</a> group, but it&#8217;s all marked up with the group name, and I wouldn&#8217;t mind having a signed copy.</p>
<p>Now it&#8217;s time for lunch, which is good, because I&#8217;m quite hungry.  I hope the conference-provided lunch is decent during the tutorials, as it was last year.</p>
<p>[tags]oscon, oscon08, perl[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/oscon-2008-mastering-perl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>I Need Minions</title>
		<link>http://sirhc.us/i-need-minions/</link>
		<comments>http://sirhc.us/i-need-minions/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 18:13:41 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[Minions]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Qualcomm]]></category>
		<category><![CDATA[World Domination]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=136</guid>
		<description><![CDATA[My development group at work, for the last couple of years, has been composed of three senior level programmers&#8212;two highly experienced (including myself) and one hard-working, but not as experienced. This week, the other highly experienced developer left our group &#8230; <a href="http://sirhc.us/i-need-minions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My development group at work, for the last couple of years, has been composed of three senior level programmers&mdash;two highly experienced (including myself) and one hard-working, but not as experienced.  This week, the other highly experienced developer left our group for supposedly greener pastures.</p>
<p>A couple of things resulted from this change.  First and foremost, we have a lot of slack to take up, so the rest of the year will be very busy for us.  Second, I am now the de facto lead developer in the group.  A group for which we need to hire two more developers (we had an open position before the loss of our comrade).</p>
<p>Two fresh, new, dreamy eyed developers.  For me to lead, to teach, to mold.  I like to think of these potential developers as my minions, willing to do my bidding.</p>
<p>For a while, we filled our open developer position with a temporary employee.  We tasked this person with the creation of a process work flow for our development efforts.  Something we could use to identify tasks, categorize them, prioritize them, assign them, and sometimes even work on them.  The final result of this effort looks something like this:</p>
<p><a href="/images/blog/minion-flow-bad.png"><img class="nofloat" alt="Old, poorly-designed process flow" src="/images/blog/minion-flow-bad.png" title="Old, poorly-designed process flow" /></a></p>
<p>No, no, no.  This will never do.  I can&#8217;t use this.  Look at how many boxes there are.  Not only that, look the sheer complexity introduced by all those decision branches!  I could never trust my minions with so much independent thought.  Also, I have no desire to confuse my minions any more than they already are.  So I designed a new process flow, which I believe is far simpler and easier to remember.</p>
<p><a href="/images/blog/minion-flow-good.png"><img class="nofloat" alt="New, easy-to-follow decision flow" src="/images/blog/minion-flow-good.png" title="New, easy-to-follow decision flow" /></a></p>
<p>Yes, this is more like it.  I suspect even the simplest of minions can effectively follow this process.  And if they can&#8217;t, well, we have ways of dealing with them.</p>
<p>So I need minions.  There are a few requirements, however.</p>
<ul>
<li>Familiarity with Perl (other programming languages are acceptable&mdash;except Python)</li>
<li>Experience administering Linux (or another Unix-like system, I guess)</li>
<li>Fascination for grid computing</li>
<li>Misplaced enthusiasm for supporting users</li>
<li>Blind devotion to me</li>
</ul>
<p>Not necessarily in that order.</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/i-need-minions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Falsifying Data</title>
		<link>http://sirhc.us/falsifying-data/</link>
		<comments>http://sirhc.us/falsifying-data/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 05:16:18 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[LSF]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://sirhc.us/journal/?p=133</guid>
		<description><![CDATA[One of the many expensive products we use at work is Platform LSF License Scheduler. Essentially, it&#8217;s designed to coordinate the use of even more expensive licenses in one or more LSF clusters. However, like a lot of proprietary software, &#8230; <a href="http://sirhc.us/falsifying-data/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the many expensive products we use at work is <a href="http://www.platform.com/Products/platform-lsf-license-scheduler">Platform LSF License Scheduler</a>.  Essentially, it&#8217;s designed to coordinate the use of even more expensive licenses in one or more LSF clusters.  However, like a lot of proprietary software, it has its share of bugs.</p>
<p>My task this week was to compensate for one of these bugs.  Basically, the request was to somehow lie to License Scheduler&#8217;s data collection process, convincing it that the license counts are different than the reality.  The collection process uses <a href="http://www.macrovision.com/">Macrovision</a>&#8216;s lmstat(1) command to gather license counts.  Okay, no problem.  Twenty lines of Perl later, and I have my own lmstat command, which behaves identically to the real version (which I simply execute) except the license counts have been altered.</p>
<p>In my group, we&#8217;re supposed to be working primarily on projects.  All of these projects are assigned awkward, forgettable acronyms.  So I decided that this project needed an acronym, too.  Not just any old acronym, either, but something memorable.  After a bit of searching through /usr/share/dict/words, I finally settled on Project FALSE: Falsifying Answers in the License Scheduler Environment.</p>
<p>So with my quick hack, I&#8217;ve both defeated an expensive piece of software and won the prize for the best project name so far.</p>
]]></content:encoded>
			<wfw:commentRss>http://sirhc.us/falsifying-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

