<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Al Newkirk</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/al_newkirk/" />
    <link rel="self" type="application/atom+xml" href="http://blogs.perl.org/users/al_newkirk/atom.xml" />
    <id>tag:blogs.perl.org,2009-11-03:/users/al_newkirk//829</id>
    <updated>2013-02-25T06:10:50Z</updated>
    <subtitle>A blog about the Perl programming language</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 4.38</generator>

<entry>
    <title>Please build this for me, yesterday, also!</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/al_newkirk/2013/02/please-build-this-for-me-yesterday-also.html" />
    <id>tag:blogs.perl.org,2013:/users/al_newkirk//829.4379</id>

    <published>2013-02-25T06:00:45Z</published>
    <updated>2013-02-25T06:10:50Z</updated>

    <summary>use Port::Authority; Port::Authority would be a module which assigns and tracks ports for use with multiple application servers running on the same box. It would need an algorithm, capable of generating reproducible results, to generate port numbers in which are...</summary>
    <author>
        <name>Al Newkirk</name>
        <uri>http://ana.im/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/al_newkirk/">
        <![CDATA[<p>use Port::Authority;</p>

<p>Port::Authority would be a module which assigns and tracks ports for use with multiple application servers running on the same box. It would need an algorithm, capable of generating reproducible results, to generate port numbers in which are available, maybe it could be based on a namespace or random string + current user (etc), or maybe you could be able to specify the type of algorithm (e.g. UUID). </p>

<p>I need this yesterday for a variety of reason, what do you guys think?</p>]]>
        
    </content>
</entry>

<entry>
    <title>Please build this for me, yesterday!</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/al_newkirk/2013/02/please-build-this-for-me-yesterday.html" />
    <id>tag:blogs.perl.org,2013:/users/al_newkirk//829.4358</id>

    <published>2013-02-20T09:38:44Z</published>
    <updated>2013-02-20T09:47:44Z</updated>

    <summary>#!/usr/bin/env perl =head1 NAME App-sourcery =head1 USAGE # loads all @assets within $path and reports any not referenced in at-least one of the @sources ./sourcery --path=/var/www --asset=*.css --asset=*.js --asset=*.png --source=*.html =head1 DESCRIPTION Often times I&apos;ll find myself mucking around with...</summary>
    <author>
        <name>Al Newkirk</name>
        <uri>http://ana.im/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/al_newkirk/">
        <![CDATA[<p>#!/usr/bin/env perl</p>

<p>=head1 NAME</p>

<p>App-sourcery</p>

<p>=head1 USAGE</p>

<p>     # loads all @assets within $path and reports any not referenced in at-least one of the @sources<br />
     ./sourcery --path=/var/www --asset=*.css --asset=*.js --asset=*.png --source=*.html</p>

<p>=head1 DESCRIPTION</p>

<p>Often times I'll find myself mucking around with an old webapp codebase that has had assets (css, js, images, etc) added to it over and over throughout its life, and being the neat-freak that I am I like to keep my codebase clean. </p>

<p>This (potentially) is a program that finds all files that match the specified asset and source patterns, puts them in their respective buckets, and then report the assets that are no longer being referenced anywhere.</p>

<p>=cut</p>

<p># your contribution here please, thanks.</p>]]>
        
    </content>
</entry>

<entry>
    <title>The Power of the Sun, in the Palm of your Hand</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/al_newkirk/2013/02/the-power-of-the-sun-in-the-palm-of-your-hand.html" />
    <id>tag:blogs.perl.org,2013:/users/al_newkirk//829.4256</id>

    <published>2013-02-05T01:26:33Z</published>
    <updated>2013-02-05T01:33:08Z</updated>

    <summary>Over the weekend I worked on a new Perl library, MongoDB::QueryBuilder, a tool which is designed to simplify composing complex and dynamic queries for MongoDB in a chainable and object-oriented fashion. Seldomly do we see examples of querying a MongoDB...</summary>
    <author>
        <name>Al Newkirk</name>
        <uri>http://ana.im/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/al_newkirk/">
        <![CDATA[<p>Over the weekend I worked on a new Perl library, MongoDB::QueryBuilder, a tool which is designed to simplify composing complex and dynamic queries for MongoDB in a chainable and object-oriented fashion.</p>

<p>Seldomly do we see examples of querying a MongoDB datastore of significant size and complexity, however, as your application grows and your data evolves, the questions you&#8217;ll want to ask your datastore will become more intricate.</p>

<p>For example. Let&#8217;s suppose we have an inventory management application that tracks equipment used in our business. Over time the business grows as does the database and (for whatever reason) we want to ask the database to &#8220;give us the (serial number, asset type, and the location manager&#8217;s name and phone number) closest to one-of-the-three latitude/longitude coordinates we will provide where the asset has been inspected and placed in a bin-location&#8221;. Oh, and limit that result-set by 100 documents.</p>

<p>Using MongoDB::QueryBuilder, the abstraction might resemble the following:</p>

<pre><code>use MongoDB::QueryBuilder;

my $query = MongoDB::QueryBuilder-&gt;new(
    only =&gt; [
        'serial_number',
        'asset.type.name',
        'asset.location.phone',
        'asset.location.manager.name'
    ],
    and_where =&gt; [
        'asset.location.bin$ne' =&gt; undef,
        '$or' =&gt; [ # this condition will short-circuit
            {'asset.location.latlng$near' =&gt; [$a, $b]},
            {'asset.location.latlng$near' =&gt; [$c, $d]},
            {'asset.location.latlng$near' =&gt; [$e, $f]}
        ]
    ],
    limit =&gt; 100
);
</code></pre>

<p>Needless to say, manually producing the code to query the database would be a
bit more involved. Another noteworthy feature is that the query-builder object
is chainable which allows you to create classes that will return a result-set.</p>

<p>For example. Considering the aforementioned scenario.</p>

<pre><code>package MyApp::Inventory::Assets;

use MongoDB::QueryBuilder;

has 'query';
sub _build_query { MongoDB::QueryBuilder-&gt;new }

sub has_been_inspected {
    my $self = shift;
    $self-&gt;query-&gt;and_where('asset.location.bin$ne' =&gt; undef);
    return $self;
}

sub is_located_near {
    my $self = shift;
    $self-&gt;query-&gt;and_where('asset.location.latlng$near' =&gt; [@_]);
    return $self;
}

sub limit {
    my $self = shift;
    $self-&gt;query-&gt;limit($_[0] || 100);
    return $self;
}

package main;

my $assets = MyApp::Inventory::Assets-&gt;new;

my $cursor = $assets-&gt;limit(25)-&gt;has_been_inspected;

while (my $asset = $cursor-&gt;next) {
    say $asset-&gt;{serial_number};
}
</code></pre>

<p>.. I rushed through the demonstration, sorry. I&#8217;m extremely busy these days. I
hope this module will be of as-much use to others as it is to me (at-the-moment).</p>

<p>The end.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Form Rendering: Why Do We Even Bother?</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/al_newkirk/2013/01/form-rendering-why-do-we-even-bother.html" />
    <id>tag:blogs.perl.org,2013:/users/al_newkirk//829.4169</id>

    <published>2013-01-02T12:27:01Z</published>
    <updated>2013-01-02T13:30:40Z</updated>

    <summary>Over the holiday I decided to do some development work even-though I had promised myself I wouldn&apos;t work on any open-source projects until all my commercial projects were completed. I was bored, and since the alcohol and party-favors had lost...</summary>
    <author>
        <name>Al Newkirk</name>
        <uri>http://ana.im/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/al_newkirk/">
        <![CDATA[<p>Over the holiday I decided to do some development work even-though I had promised myself I wouldn't work on any open-source projects until all my commercial projects
were completed.</p>

<p>I was bored, and since the alcohol and party-favors had lost there seductiveness, I thought I might revisit my super-secret-open-source-software-todo-list (we've all
got one). I was looking for something complex enough to hold my interest yet simple enough to implement or at-least get a proof-of-concept out.</p>

<p>Since I've been doing a bunch of work on Validation::Class lately, I decided to work on an idea for a form field rendering plugin. First I'd like to exclaim, "I hate all-inclusive-html-form-handling-libraries", maybe not hate them but I strongly disagree with the premise upon which they are built.</p>

<p><a href="http://goo.gl/5u9ro">Validation::Class::Plugin::FormFields</a> is a plugin for Validation::Class which can leverage your validation class field definitions to render HTML form elements. Currently, the plugin is intentionally lacking in sophistication in an attempt to take as few liberties as possible (taking liberties is what makes most form renders suck).</p>

<p>Validation::Class::Plugin::FormFields is not an HTML form handler, nor is it an HTML form builder, renderer, construction kit, or framework. It merely renders a single HTML element at-a-time with as-little-markup-as-possible using the state of the associated validation class to maintain the state of the HTML form field.</p>

<p>Why render fields individually and not the entire form? HTML form handling is a heavily opinionated subject and the following reflects my opinion. HTML form rendering (done literally) has too many constraints and considerations to ever be ideally implemented. Consider the following; It's been tried many many times before and there are many different libraries as a result; It's never done quite right; There are too many conflicting contexts (e.g. css, js, security and identification, etc), i.e., CSS wants the form configured a certain way for styling purposes, JS wants the form configured a certain way for introspection purposes, the APP (and possibly the form renderer) wants the form configured a certain way for processing purposes, etc.</p>

<p>So why do we continue to try? "HTML forms are like werewolves and developers love silver bullets"(tm), but bullets are actually made out of lead, not silver. So how do you kill werewolves with lead? Protip, not by shooting them, obviously. I'd argue that we never really wanted complete form rendering anyway, what we actually wanted was a simple way to reduce the tedium and repetitiveness that comes with creating HTML form elements and handling submission and validation of the resulting data. We keep getting it wrong because we keep trying to build on top of the same misconceptions.</p>

<p>An HTML form is predominantly a UI by-product, and in large organizations (especially those which have segmented UI/ENG development teams) an HTML form and it's structure, layout, and markup are typically determined by the UI developers. Many HTML form renders are not viable simply because they impose UI decisions or require to much engineering to conform to the UI specifications.</p>

<p>So maybe we should backup a bit and try something different. In my opinion, the generating of HTML elements individually is much less constrained and definitely much
easier to implement.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>A Killer Feature for Mojolicious</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/al_newkirk/2012/12/a-killer-feature-for-mojolicious.html" />
    <id>tag:blogs.perl.org,2012:/users/al_newkirk//829.4147</id>

    <published>2012-12-23T17:52:06Z</published>
    <updated>2012-12-23T17:56:16Z</updated>

    <summary>I just thought of a truly killer feature for Mojolicious. You are undoubtedly asking yourself why I don&apos;t just share this with the Mojolicious team on IRC or GitHub, etc. Most of you undoubtedly already know the answer to that,...</summary>
    <author>
        <name>Al Newkirk</name>
        <uri>http://ana.im/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/al_newkirk/">
        <![CDATA[<p>I just thought of a truly killer feature for Mojolicious. You are undoubtedly
asking yourself why I don't just share this with the Mojolicious team on IRC or
GitHub, etc. Most of you undoubtedly already know the answer to that, but I
digress.</p>

<p>Many shops that I've worked with have this concept generally referred to as
content-injection or template filtering depending on how you go about it. It is
basically a means of hooking into template rendering after the template has been
rendered but before it has been output (or otherwise used by the application).</p>

<p>The problem this solves is that some things are best left to be handled by the
template, while other things are best done by using regex or a DOM parser.</p>

<p>I believe Mojolicious is at a unique advantage to offer something like this
out-of-the-box because it has it's own templating system -and- it's own DOM
parser. An example of a mojolicious template using the technique I'm describing
could be as follows:</p>

<pre><code>__DATA__

@@ alter_me.html.ep
&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Alter me!&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;You've been altered.&lt;/body&gt;
&lt;/html&gt;

% filter begin
% my ($c, $dom) = @_; # is passed the DOM parser using rendered template
  $dom-&gt;at('title')-&gt;replace_content('because I can');
% end

@@ further_convince_me.html.ep
&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Convince me!&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;select id="industry" value="" name="industry"&gt;
      &lt;option id="industry" value="" name="industry"&gt;Please Select…&lt;/option&gt;
      &lt;option id="industry" value="Aerospace &amp;amp; Defense" name="industry"&gt;Aerospace &amp;amp; Defense&lt;/option&gt;
      &lt;option id="industry" value="Agriculture" name="industry"&gt;Agriculture&lt;/option&gt;
      &lt;option id="industry" value="Automotive &amp;amp; Transport" name="industry"&gt;Automotive &amp;amp; Transport&lt;/option&gt;
      &lt;option id="industry" value="Banking" name="industry"&gt;Banking&lt;/option&gt;
      &lt;option id="industry" value="Beverages" name="industry"&gt;Beverages&lt;/option&gt;
      &lt;option id="industry" value="Business Services" name="industry"&gt;Business Services&lt;/option&gt;
      &lt;option id="industry" value="Charitable Organizations" name="industry"&gt;Charitable Organizations&lt;/option&gt;
      &lt;option id="industry" value="Chemicals" name="industry"&gt;Chemicals&lt;/option&gt;
      &lt;option id="industry" value="Computer Hardware" name="industry"&gt;Computer Hardware&lt;/option&gt;
      &lt;option id="industry" value="Computer Services" name="industry"&gt;Computer Services&lt;/option&gt;
      &lt;option id="industry" value="Computer Software" name="industry"&gt;Computer Software&lt;/option&gt;
      &lt;option id="industry" value="Construction" name="industry"&gt;Construction&lt;/option&gt;
      &lt;option id="industry" value="Consumer Products Manufacturers" name="industry"&gt;Consumer Products Manufacturers&lt;/option&gt;
      &lt;option id="industry" value="Consumer Services" name="industry"&gt;Consumer Services&lt;/option&gt;
      &lt;option id="industry" value="Cultural Institutions" name="industry"&gt;Cultural Institutions&lt;/option&gt;
      &lt;option id="industry" value="Education" name="industry"&gt;Education&lt;/option&gt;
      &lt;option id="industry" value="Electronics" name="industry"&gt;Electronics&lt;/option&gt;
      &lt;option id="industry" value="Energy &amp;amp; Utilities" name="industry"&gt;Energy &amp;amp; Utilities&lt;/option&gt;
      &lt;option id="industry" value="Entertainment" name="industry"&gt;Entertainment&lt;/option&gt;
      &lt;option id="industry" value="Environmental Services &amp;amp; Equipment" name="industry"&gt;Environmental Services &amp;amp; Equipment&lt;/option&gt;
      &lt;option id="industry" value="Financial Services" name="industry"&gt;Financial Services&lt;/option&gt;
      &lt;option id="industry" value="Food" name="industry"&gt;Food&lt;/option&gt;
      &lt;option id="industry" value="Foundations" name="industry"&gt;Foundations&lt;/option&gt;
      &lt;option id="industry" value="Government" name="industry"&gt;Government&lt;/option&gt;
      &lt;option id="industry" value="Health Care" name="industry"&gt;Health Care&lt;/option&gt;
      &lt;option id="industry" value="Industrial Manufacturing" name="industry"&gt;Industrial Manufacturing&lt;/option&gt;
      &lt;option id="industry" value="Insurance" name="industry"&gt;Insurance&lt;/option&gt;
      &lt;option id="industry" value="Leisure" name="industry"&gt;Leisure&lt;/option&gt;
      &lt;option id="industry" value="Media" name="industry"&gt;Media&lt;/option&gt;
      &lt;option id="industry" value="Membership Organizations" name="industry"&gt;Membership Organizations&lt;/option&gt;
      &lt;option id="industry" value="Metals &amp;amp; Mining" name="industry"&gt;Metals &amp;amp; Mining&lt;/option&gt;
      &lt;option id="industry" value="Pharmaceuticals" name="industry"&gt;Pharmaceuticals&lt;/option&gt;
      &lt;option id="industry" value="Real Estate" name="industry"&gt;Real Estate&lt;/option&gt;
      &lt;option id="industry" value="Retail" name="industry"&gt;Retail&lt;/option&gt;
      &lt;option id="industry" value="Security Products &amp;amp; Services" name="industry"&gt;Security Products &amp;amp; Services&lt;/option&gt;
      &lt;option id="industry" value="Telecommunications Equipment" name="industry"&gt;Telecommunications Equipment&lt;/option&gt;
      &lt;option id="industry" value="Telecommunications Services" name="industry"&gt;Telecommunications Services&lt;/option&gt;
      &lt;option id="industry" value="Transportation Services" name="industry"&gt;Transportation Services&lt;/option&gt;
      &lt;option id="industry" value="Technology" name="industry"&gt;Technology&lt;/option&gt;
      &lt;option id="industry" value="Other" name="industry"&gt;Other&lt;/option&gt;
  &lt;/select&gt;
  &lt;/body&gt;
&lt;/html&gt;

% filter begin
% my ($c, $dom) = @_;
  $dom-&gt;at('#industry option[value*="'. $c-&gt;param('industry') .'"]')-&gt;attrs(selected =&gt; 'selected');
% end
</code></pre>
]]>
        

    </content>
</entry>

<entry>
    <title>Say it once, Don&apos;t Repeat It</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/al_newkirk/2012/12/say-it-once-dont-repeat-it.html" />
    <id>tag:blogs.perl.org,2012:/users/al_newkirk//829.4110</id>

    <published>2012-12-08T11:19:56Z</published>
    <updated>2012-12-08T18:25:56Z</updated>

    <summary>The following is a story about me (you can call me &quot;guy&quot;) who was working as a consultant on-location (we can refer to as heaven) where he had an interesting conversation with one of the lead system architects (herein after...</summary>
    <author>
        <name>Al Newkirk</name>
        <uri>http://ana.im/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/al_newkirk/">
        <![CDATA[<p>The following is a story about me (you can call me "guy") who was working as a<br />
consultant on-location (we can refer to as heaven) where he had an interesting<br />
conversation with one of the lead system architects (herein after referred<br />
to as God).</p>

<p>One day, Guy explained to God that the webapp has many parameters hitting it,<br />
some of which are actually the same types of parameters but with varying and<br />
arbitrary names, and that while there's is no realistic way to stop the Angels<br />
from creating templates with parameters named however they choose, Guy suggested<br />
to God that he use Validation::Class to help organize/standardize the<br />
handling of parameters in the webapp and specifically leverage it's automatic<br />
handling of parameter aliases. God chuckles, "but that would suggest that we<br />
would need to create two definitions describing the same piece of data" said God<br />
referring to the existing Moose attribute definitions, and the proposed<br />
Validation::Class field definitions. I tried to talk to God about context and<br />
how different rules apply at different layers but god is ... well God. The<br />
following is much of what was discussed when I last talked to God.</p>

<p>Before I begin, I'd first like to regurgitate a statement from the Validation::Class<br />
whitepaper which reads, "A data validation framework exists to handle failures,<br />
it is its main function and purpose, in-fact, the difference between a validation<br />
framework and a type-constraint system is how it responds to errors. There are<br />
generally two types of errors that occur in an application, user-errors which<br />
are expected and should be handled and reported so that a user can correct the<br />
problem, and system-errors which are unexpected and should cause the application<br />
to terminate and/or handling the exception. Exception handling is the process of<br />
responding to the occurrence, during computation, of exceptions (anomalous or<br />
exceptional situations).".</p>

<p>For the readers that may not already be aware, your OO system is NOT a<br />
user-input validation mechanism nor should it be used as such.</p>

<p>The following is just one of many cases to be made about why you shouldn't use<br />
your OO system for user-input validation.</p>

<p>A "field" in Validation::Class is not the same as an attribute in an OO system,<br />
i.e. in Validation::Class fields are never required to be present. This means<br />
that any field in a class can be validated individually or in concert with any<br />
other field(s) which is very useful. In order to achieve this with an OO system<br />
you would need to either make all attributes optional or make required attributes<br />
able to accept undefined values. Both choices leave you making a poor design<br />
decision. Consider the following OO configuration:</p>

<p>    # has 'a'<br />
    # isa 'maybe|Str'<br />
    # required</p>

<p>    # has 'b'<br />
    # isa 'maybe|Str'<br />
    # required</p>

<p>In order to validate (a or b) independently I would be forced to declare<br />
both attributes as optional or (if undef values are accepted) have the calling<br />
class determine which arguments are missing and fake them as both would need to<br />
be present at the time of instantiation, even if as undef. There are a few more<br />
approaches I can think of, none of them ideal. Needless to say that by making<br />
all attributes optional you've effectively bypass the single point-of-validation;<br />
I hope that statement is self-explanitory.</p>

<p>Alternatively, and I imagine more commonly, you could define your class<br />
normally, throw in some coercions, trap and massage exceptions, then report<br />
those "exceptions" to your users (poor saps), and hopefully you app is only<br />
localized for one language or your could design your exception traps to be aware<br />
of the end-users language and throw localized exceptions. And if you're doing<br />
all that then you're basically rolling your own validation framework and that's<br />
just awesome, .. and I'm sure you've covered every nuance and consideration :}</p>

<p>Consider the following V:C configuration:</p>

<p>    # field 'a'<br />
    # required</p>

<p>    # field 'b'<br />
    # required</p>

<p>No field is required to be present and there is no single point-of-validation,<br />
i.e. the validation logic is not in the constructor and because it is separate<br />
and accessible as a function on the class we can validate and re-validate at-will.</p>

<p>For the sake of clarity, I use the phrase single-point-of-validation to mean<br />
that, in an OO system, technically once you get pass the constructor each method<br />
assumes the data remains valid, even if the data has passed through multiple<br />
methods which manipulates the data, and there is no way to recall the validation<br />
logic in the constructor (afaik).</p>

<p>... So that was a long-winded explanation of the obvious, OO-type-contraint<br />
systems are not practical for user-input validation and definitely not as practical<br />
as a "real" validation library, like Validation::Class. But you already knew that.</p>

<p>Just the other day, Mithaldu explained to me that re-usability of Validation::Class<br />
is one of it's greatest strengths but he didn't think I touched on it enough in<br />
the documentation, especially in the form of an example.</p>

<p>I explained to him that Validation::Class was created around the philosophy of<br />
"Say it Once", i.e. to declare validation rules once, use them anywhere/everywhere.<br />
I told him that once your defined a validation class using the keywords (sugar),<br />
you could use the single class to validate data in your webapp controller,<br />
model, command-line scripts and even on the client via JavaScript, and anytime<br />
the validation rules change, so will these affected areas. He said, "Next time<br />
lead with that", and then he challenged me to put together a small program that<br />
showcased my claims.</p>

<p>So here it is, the following is a minimalistic example of a micro webapp using<br />
Validation::Class on the client and server.</p>

<p>github: <a href="https://github.com/alnewkirk/dry.cgi/blob/master/dry.cgi">https://github.com/alnewkirk/dry.cgi/blob/master/dry.cgi</a><br />
demo: <a href="http://sandbox.anewkirk.dev.ana.io/">http://sandbox.anewkirk.dev.ana.io/</a></p>

<p>* dry.cgi uses a single validation class to validate a mojolicious-lite app<br />
parameters on both client-side and server-side. We could also use the validation<br />
class as a buffer for our data model.<br />
</p>]]>
        
    </content>
</entry>

<entry>
    <title>Candy-Coated Data Validation; Codename: ShuhgaBear</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/al_newkirk/2012/12/candy-coated-data-validation-codename-shuhgabear.html" />
    <id>tag:blogs.perl.org,2012:/users/al_newkirk//829.4101</id>

    <published>2012-12-05T03:10:36Z</published>
    <updated>2012-12-05T03:22:47Z</updated>

    <summary>2-CENTS This week, in the intertubes, I came across a Node.js validation library which seemed to be popular amongst &quot;those people&quot;. At-a-glance, as far as validation libraries go, I didn&apos;t think it was that well done, but I must admit...</summary>
    <author>
        <name>Al Newkirk</name>
        <uri>http://ana.im/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/al_newkirk/">
        <![CDATA[<h1>2-CENTS</h1>

<p>This week, in the intertubes, I came across a Node.js validation library which
seemed to be popular amongst "those people". At-a-glance, as far as validation
libraries go, I didn't think it was that well done, but I must admit to noticing
a certain appeal in the expressiveness of the design which I suppose is due
largely to that fact that its a JavaScript library.</p>

<p>Anyway, I decided that it would be cool to try and mimic the expressiveness
while using Validation::Class as the foundation. It started as a feature-branch
on Github but I was amazed at how quickly the concept came to fruition. The
results is a module called Validation::Class::Simple::Streamer which has been
added to the master-branch on Github as an optional experimental addition to the
distribution.</p>

<p>Why? Validation::Class is design for a codebase that desires to be optimized and
take advantage of compartmentalization and reusability, etc., though it requires
some forethought and configuration. Validation::Class::Simple was added to
provide a "container-class" to allow developers to use Validation::Class they
way they would a traditional data validation library, in an ad-hoc fashion not
interested in the advanced setup, etc. Validation::Class::Simple::Streamer was
created because its a simple, maybe even fun, way of validating data and offers
a low barrier-to-entry for people that don't care to configure the full
framework.</p>

<h1>SYNOPSIS</h1>

<pre><code>use Validation::Class::Simple::Streamer;

my $params = Validation::Class::Simple::Streamer-&gt;new($parameters);

unless ($params-&gt;check('email_address')-&gt;length(3)-&gt;email) {
    # validated login, password and email_address
}

unless ($params-&gt;check('home_phone')-&gt;telephone) {
    # validated login, password, email_address and home_phone
}

$params-&gt;check('password');

# be as expressive as you like
ok() if
    # validates login, password, email_address and home_phone
    $params-&gt;max_length(15) &amp;&amp;
    $params-&gt;min_symbols(1) &amp;&amp;
    $params-&gt;matches('password2')
;

# using your own workflow
$params-&gt;check($_)-&gt;filters('trim, strip') for qw(login password);

# are you of legal age?
if ($params-&gt;check('user_age')-&gt;between('18-75')) {
    # access to explicit content approved
    # validated login, password, email_address, home_phone and user_age
}

# validate like a boss
# THE END
</code></pre>

<h1>DESCRIPTION</h1>

<p>Validation::Class::Simple::Streamer is a simple streaming validation module
that makes data validation fun. It is built around the powerful
<a href="http://search.cpan.org/perldoc?Validation::Class">Validation::Class</a> data validation framework via <a href="http://search.cpan.org/perldoc?Validation::Class::Simple">Validation::Class::Simple</a>.</p>

<p>This module is/was inspired by the simplicity and expressiveness of the Node.js
validator library, <a href="https://github.com/chriso/node-validator">https://github.com/chriso/node-validator</a>, but built on top
of the ever-awesome Validation::Class framework, which is designed to be modular
and extensible, i.e. whatever custom directives you create and install will
become methods on this class which you can then use to enforce policies.</p>

<h1>GITHUB LINK</h1>

<p><a href="http://goo.gl/2sZvu">http://goo.gl/2sZvu</a></p>

<h1>MISC BANTER</h1>

<ul>
<li>[19:55] <em>*</em> Now talking to ironcamel</li>
<li>[20:49] anewkirk: speaking of Validation::Class, I just added a new feature called simple-streamer</li>
<li>[20:58] ironcamel: can you give me a summary of what it does</li>
<li>[20:59] anewkirk: sure, it allows you to define rules as-you-go and in boolean-context it calls validate for you automatically</li>
<li>[21:00] anewkirk: imagine a dancer plugin</li>
<li>[21:00] anewkirk: that exports a method named check()</li>
<li>[21:00] anewkirk: ... and then in your route handler you simply say</li>
<li>[21:01] anewkirk: return '/dashboard' if check('login')->required->min_length(5)</li>
<li>[21:01] anewkirk: you're not pre-declaring rules at this point</li>
<li>[21:01] anewkirk: and that code actually works</li>
<li>[21:01] ironcamel: unless ($params->check('home_phone')->telephone) {</li>
<li>[21:02] ironcamel: what is ->telephone() and who defines it?</li>
<li>[21:02] anewkirk: telephone is the directive</li>
<li>[21:02] anewkirk: as in ....</li>
<li>[21:02] ironcamel: it is a built in thing?</li>
<li>[21:03] anewkirk: field home_phone => { telephone => 1 };</li>
<li>[21:03] ironcamel: what?</li>
<li>[21:03] anewkirk: check out https://github.com/chriso/node-validator</li>
<li>[21:04] anewkirk: it node.js validation library</li>
<li>[21:05] anewkirk: I was inspired by HTML::Zoom also -- https://metacpan.org/module/HTML::Zoom</li>
<li>[21:06] anewkirk: which mst calls a streaming template engine because you're not really manipulating the template until its rendered</li>
<li>[21:06] anewkirk: basically the functions build-up instructions which all get executed once you call render</li>
<li>[21:09] anewkirk: its a play on the literal definition of streaming</li>
<li>[21:09] anewkirk: ok, so check('foobar')->required->min_symbols doesn't do any validation, those functions simply queue-up instructions</li>
<li>[21:09] anewkirk: so its kinda streaming the validation event</li>
<li>[21:09] ironcamel: maybe Validation::Class::Simple::Sugar would be better</li>
<li>[21:10] ironcamel: i don't get it</li>
<li>[21:10] anewkirk: but its not really sugar</li>
<li>[21:10] ironcamel: are you thinking it is streaming because you are chaining method calls?</li>
<li>[21:10] anewkirk: the chainable nature of the functions makes it stream-like, yes</li>
<li>[21:10] ironcamel: it kind of is sugar</li>
<li>[21:10] anewkirk: well ...</li>
<li>[21:10] anewkirk: maybe</li>
<li>[21:11] ironcamel: because ->length(3) is sugar for (length($foo) eq 3)</li>
<li>[21:11] ironcamel: *==</li>
<li>[21:11] anewkirk: yes and no</li>
<li>[21:11] ironcamel: chaining functions has nothing to do with streaming</li>
<li>[21:12] anewkirk: i know, its a play on the concept of streaming</li>
<li>[21:23] ironcamel: i would probably use Validation::Class::Simple for most of my own personal projects</li>
<li>[21:24] ironcamel: so it almost seams like the streamer thing should be Validation::Nodeish</li>
<li>[21:24] ironcamel: Validator::Node</li>
<li>[21:24] ironcamel: yes</li>
<li>[21:24] anewkirk: oh god no hahaha</li>
</ul>
]]>
        

    </content>
</entry>

<entry>
    <title>Validation::Class: Released version 7.900001</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/al_newkirk/2012/12/validationclass-released-version-7900001.html" />
    <id>tag:blogs.perl.org,2012:/users/al_newkirk//829.4092</id>

    <published>2012-12-02T17:26:31Z</published>
    <updated>2012-12-02T17:57:01Z</updated>

    <summary>I wanted to formally annouce the release of Validation::Class, as of version 7.900001 the codebase is dramatically different though it maintains backwards compatibility at about 95%. The following is the current complete list of core directives (validation rules). As stated...</summary>
    <author>
        <name>Al Newkirk</name>
        <uri>http://ana.im/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/al_newkirk/">
        <![CDATA[<p>I wanted to formally annouce the release of Validation::Class, as of version
7.900001 the codebase is dramatically different though it maintains backwards
compatibility at about 95%. The following is the current complete list of core
directives (validation rules). As stated in the documentation, the purpose of
the core directives is merely to provide a reasonable layer of protection
against bad/malformed data and validators are not very sophisticated. e.g. the
email directive does not perform a host lookup, etc:</p>

<pre><code>alias           - handles parameter aliases
between         - handles numeric range validation
city            - handles city/area validation for cities in the USA
creditcard      - handles validation for credit cards
date            - handles validation of simple date formats
decimal         - handles validation of floating point integers
default         - hold the value used if no parameter exists
depends_on      - validates the existence of dependent parameters
email           - checks the validity of email addresses
error           - holds the error message that will supersede other errors
errors          - used internally
filtering       - specifies pre-or-post filtering per field
filters         - specifies list of filters per field
hostname        - handles validatation of server hostnames
label           - holds a user-friendly string (name) representing the field
length          - validates the exact length
matches         - validates that dependent parameter values match
max_alpha       - validates the length of alphabetic characters
max_digits      - validates the length of numeric characters
max_length      - validates the length of all characters
max_sum         - validates the numeric value
max_symbols     - validates the length of non-alphanumeric characters
messages        - holds error message which will supersede class-level messages
min_alpha       - validates the length of alphabetic characters
min_digits      - validates the length of numeric characters
min_length      - validates the length of all characters
min_sum         - validates the numeric value
min_symbols     - validates the length of non-alphanumeric characters
mixin           - specifies list of mixins to merge
mixin_field     - specifies list of fields to merge
multiples       - validates whether multi-value parameters are expected
name            - used internally
options         - enumerated list of values to be validated against
pattern         - handles validation of simple patterns and complex regular expressions
readonly        - ignore parameter values
required        - validation of supply and demand
ssn             - validation of social security numbers in the USA
state           - handles state validation for states in the USA
telephone       - handles telephone number validation for the USA and North America
time            - handles validation for standard time formats
toggle          - used internally
uuid            - handles validation of globally/universally unique identifiers
validation      - execute user-defined validation routines
value           - hold the absolute value
zipcode         - handles postal-code validation for areas in the USA and North America
</code></pre>

<p>Check it out on <a href="http://goo.gl/gNW96">MetaCPAN</a>. </p>

<p>If you like it, like it, follow it, etc. 
If you hate it, let me know why, please. </p>

<p>Thanks.</p>

<p>If you are interested in helping me extend the library by creating your own
directive classes, contact me socially, IRC (anewkirk|anaio), or checkout the
directives base class.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Operate with Impunity</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/al_newkirk/2012/11/operate-with-impunity.html" />
    <id>tag:blogs.perl.org,2012:/users/al_newkirk//829.4068</id>

    <published>2012-11-26T08:38:27Z</published>
    <updated>2012-11-26T18:11:42Z</updated>

    <summary>I am 99.9999% done with a complete rewrite of Validation::Class. I have also written a decent amount of documentation on how you should use the library and why you should use the library. Within the documentation you can also find...</summary>
    <author>
        <name>Al Newkirk</name>
        <uri>http://ana.im/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/al_newkirk/">
        <![CDATA[<p>I am 99.9999% done with a complete rewrite of Validation::Class. I have also written a decent amount of documentation on how you should use the library and why you should use the library.</p>

<p>Within the documentation you can also find a whitepaper that offers insight into the rational behind the framework and why it was created. This project has become a fascination of mine over the past year as I've used it in many personal projects and client projects and have been inspired to continuously innovate. </p>

<p>Currently, the core feature-set consist of self-validating methods, validation profiles, reusable validation rules and templates, pre and post input filtering, class inheritance, automatic array handling, and extensibility (e.g. overriding default error messages, creating custom validators, creating custom input filters and much more). Additionally, I hope to present some of my plans for the future of this project at one of the upcoming conferences (though I'm not as plugged-in as I'd like to be). </p>

<p>For those of you that don't know, lately I've been contracting with Rent.com which is (IMHO) one of the nicest Perl shops around. They have really cool and intelligent people there (this is a non-biased statement, honest). Anyway, I just wanted to mention that during my last trip there (Santa Monica, CA), I had the pleasure of attending a local Perl mongers meetup where I talked-shop with a great group of guys that share my passion for Perl programming, ... which was really cool.</p>

<p>Anyway, I've become a bit of a data validation nut (obviously) and I've been letting it drive app development, and I haven't been disappointed. One of my near-future plans for Validation::Class is to ship with the ability to allow parameters to propagate objects (I'm talking about coercion for you Moose-heads). Validation::Class could effectively become a sweet coercion framework for Moose-based classes (and other object systems).</p>

<p>The following is an excerpt from the whitepaper which you can view <a href="http://goo.gl/UKofk">here on github</a> for the full-paper. For a simpler introduction with less-fluff, checkout the markdown for Validation::Class::Simple <a href="http://goo.gl/gEfk2">here</a>.</p>

<h2>INTRODUCTION</h2>

<p>This whitepaper will serves as a guide to help readers understand the common
data validation issues as well as the the rationale and various usage scenarios
for Validation::Class.</p>

<p>Data validation is an important aspect of every application yet it is often
overlooked or neglected. Data validation should be thought of as your data input
firewall, a layer that exist between the user of your application and the
application's business objects.</p>

<h2>DATA VALIDATION PROBLEMS</h2>

<p>The most common application security weakness is the failure to properly
validate input from the client or environment. Data validation is important
because it provides security, it allows you to ensure user supplied data is
formatted properly, is within length boundaries, contains permitted characters
and adheres to business rules.</p>

<p>To understand the problem domain we need to first understand:</p>

<ul>
<li>what is meant by data validation</li>
<li>what the standard validation types are</li>
<li>what the common use-cases are were validation applies</li>
</ul>

<p>First, data validation is the process of auditing a piece of data to ensure it
fits a specific criteria. Common data validation checks are:</p>

<ul>
<li>existence checking</li>
<li>range checking</li>
<li>type checking</li>
<li>list-lookup checking</li>
<li>dependency checking</li>
<li>pattern checking</li>
<li>custom validation checking</li>
</ul>

<p>Typically when designing an application we tend to name input parameters in an
arbitrarily fashion and validate the same data at various stages during a
program's execution (duplicating logic and validation routines) in various
places in the application stack. This approach is inefficient and prone to bugs,
inconsistencies and security problems.</p>

<p>Data can be submitted to an application in various formats and it is not always
ideal, and the option to pre-format the data is not always ideal or even
possible. A few common use-cases were validation is required and often fails
(in a big big way) are as follows:</p>

<ul>
<li>handling arbitrarily and/or dynamically-named parameters</li>
<li>handling input for batch-processing</li>
<li>handling multi-type parameters (array or scalar depending on context)</li>
<li>handling complex conditional validation logic</li>
<li>handling multi-variant parameter names (aliases)</li>
<li>handling parameter dependencies</li>
<li>handling errors (reporting messages, localization, etc)</li>
</ul>

<h2>A DATA VALIDATION SOLUTION</h2>

<p>A better approach to data validation is to first consider each parameter hitting
your application as a transmission fitting a very specific criteria and
construct a data validation layer that operates with that in mind
(e.g. exactly like a network firewall). Your data validation rules should act
as filters which will accept or reject and format the transmission for use
within your application.</p>

<p>A proper validation framework should allow you to model data and construct
validation objects with a focus on structuring rules, reusing common declarations,
defining input filters and validating data. Its main purpose should be to
properly handle data input errors. It's ulterior motive should be to ensure
consistency and promote reuse of data validation rules.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Sexual Harassment?</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/al_newkirk/2012/09/sexual-harassment.html" />
    <id>tag:blogs.perl.org,2012:/users/al_newkirk//829.3828</id>

    <published>2012-09-13T22:57:05Z</published>
    <updated>2012-09-13T23:01:04Z</updated>

    <summary>package Company::Connection; use Moose; ... sub connection { my ($self, @args) = @_; # @Linda: I hope this isn&apos;t creepy but if you&apos;re reading this I just # want to say I think you&apos;re awesome and we should go out...</summary>
    <author>
        <name>Al Newkirk</name>
        <uri>http://ana.im/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/al_newkirk/">
        <![CDATA[<p>package Company::Connection;</p>

<p>use Moose;</p>

<p>...</p>

<p>sub connection {</p>

<p>    my ($self, @args) = @_;<br />
    <br />
    # @Linda: I hope this isn't creepy but if you're reading this I just<br />
    # want to say I think you're awesome and we should go out on a date<br />
    # sometime soon. Do you agree [Yes/No] -- Matt<br />
    <br />
    # ps. do not commit this class to the master branch!!!<br />
    <br />
    ...<br />
    <br />
    return $self;</p>

<p>}</p>

<p>1;</p>]]>
        
    </content>
</entry>

<entry>
    <title>Les Misérables</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/al_newkirk/2012/09/les-miserables.html" />
    <id>tag:blogs.perl.org,2012:/users/al_newkirk//829.3806</id>

    <published>2012-09-09T13:45:21Z</published>
    <updated>2012-09-09T13:46:47Z</updated>

    <summary>09:41 sooo fucking frustrated 09:41 but actually .... 09:41 this line just save-my-sanity -- https://metacpan.org/source/XSAWYERX/Dancer-1.3100/lib/Dancer/Template/TemplateToolkit.pm#L37 09:42 I couldn&apos;t figure out why my TT rendering engine was outputting nonsense (1hr of head-scratching elapsed), so I figured I&apos;d see how Dancer was...</summary>
    <author>
        <name>Al Newkirk</name>
        <uri>http://ana.im/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/al_newkirk/">
        <![CDATA[<p>09:41 < alnewkirk> sooo fucking frustrated<br />
09:41 < alnewkirk> but actually ....<br />
09:41 < alnewkirk> this line just save-my-sanity -- https://metacpan.org/source/XSAWYERX/Dancer-1.3100/lib/Dancer/Template/TemplateToolkit.pm#L37<br />
09:42 < alnewkirk> I couldn't figure out why my TT rendering engine was outputting nonsense (1hr of head-scratching elapsed), so I figured I'd see how Dancer was doing it<br />
09:42 < alnewkirk> I missed the problem a few times because I didn't pay attention to the comment in the code</p>]]>
        
    </content>
</entry>

<entry>
    <title>Better, Faster, Funner - Part 1</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/al_newkirk/2012/06/better-faster-funner---part-1.html" />
    <id>tag:blogs.perl.org,2012:/users/al_newkirk//829.3442</id>

    <published>2012-06-28T23:40:41Z</published>
    <updated>2012-06-29T09:23:11Z</updated>

    <summary>I&apos;ve recently started working on a new web app project using all sorts of latest-and-greatest techniques and libraries, needless to say I choose Perl to build it out. The architecture of this application is different from what I&apos;m used to...</summary>
    <author>
        <name>Al Newkirk</name>
        <uri>http://ana.im/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/al_newkirk/">
        <![CDATA[<p>I've recently started working on a new web app project using all sorts of
latest-and-greatest techniques and libraries, needless to say I choose Perl to
build it out. The architecture of this application is different from what I'm
used to but I like the direction I'm headed, everything seems to be in order,
so I'd like to share my thoughts, struggles and accomplishments.</p>

<p>The WAF (web app framework) I choose to develop around this project is  Dancer,
although I've been away from Dancer and its community since before version 1 was
officially released I decided to use it because, quite-frankly, it has nice and
robust documentation, sensible defaults, and does exactly what I need it to with
minimal code. You may have noticed that I neglected to mention the framework's
plugin ecosystem, which IMHO is not preferred for large/growing projects.</p>

<h2>The Hub</h2>

<p>I've designed the application main module (root class) to be "the source of
truth" for the entire application. This means that the root class is responsible
for providing access to configuration options in an object-oriented fashion,
allows switching between configuration profiles, writing to disk and providing
absolute path information using Self::Dir. Some hackery and caching is needed
to convince Dancer to switch configuration profiles during runtime.</p>

<h2>The 2-Step (Not the Dance)</h2>

<p>Like many other wishful thinkers I wanted the app to be completely self-contained
and deploy-able with minimal fuss. After days of tinkering and rethinking botched
deployments I came up with a simple 2-step system for deploying the app based on
my typical work-flow.</p>

<p>I created two Perl scripts in the app root, setup-server and setup-application,
both of which should be self-explanatory but allow me to elaborate. The
requirements for the scripts are as follows:</p>

<p>The setup-server script should be executed first in the install process, it only
requires that Perl 5.8+ be installed. I stringifies lists (arrays) of
dependencies (system dependencies (build-essential, cpanm, etc), system cpan
dependencies, local dependencies, system commands, etc) to be installed/executed
in a particular order. This ensures that the server has the requirements need to
run the next script, setup-application. </p>

<p>The setup-application script creates config files for various servers (web
servers, databases, etc) and installs them in the assigned locations then
starts/restarts the respective daemons. The magic CPAN library that makes
creating, starting, stopping, and restarting services fun and stress-free is
Ubic (especially when ran as root). Ubic is just pure awesome, it allows me
easily add services to my application during a development iteration and have it
just work when I re-deploy the app. I install each service to be executed via
Ubic::Service::SimpleDaemon which has the added benefit of being  automatically
restarted on failure.</p>

<h2>Stuck Between a Rock and a Hard Place</h2>

<p>I've recently started evaluating libraries to provide form rendering, validation,
general OO, and data storage.</p>

<p>Because I like using Validation::Class (which I authored) so much, for me the
obvious choice was Validation::Class::Plugin::FormFields (which I also authored)
though it has a sort of rigidness and inflexible to it, the type rigidness that
can be found in all form rendering tools that rely on templating system like
Template::Toolkit. </p>

<p>So I decided to use Validation::Class with ::Plugin::FormFields anyway and
refactor it to make it better. I came to the conclusion some time ago that
rendering forms in their entirety is too complex and specific to get right for
all or even most use-cases, and an admirable compromise would be to provide an
easy and intuitive interface to process and render form elements/fields
individually.</p>

<p>So what does a better HTML form rendering engine look like? The following are
code samples of the refactored V::C plugin I'm working on:</p>

<pre><code># $model is your V::C class instance

my $form = Validation::Class::FastForm->new(
    model => $model
);

# renders the login field as an HTML5 form input
# with data-minlength/maxlength, placeholder, etc
# and output the result

$form->render('login', 'text');
$form->render('login', 'email');
$form->render('login', 'date');
$form->render('login', 'number');

# alter you form field using css/xpath selectors
# and output the result

$form->process('login', 'text')
->change('input@type'  => 'password')
->change('input@title' => 'Please enter something here')
->data;

$form->dataset('user_type', [
    { text => 'Buyer',  value => 'buyer' },
    { text => 'Seller', value => 'seller'},
]);

$form->render('user_type', 'radio');
$form->render('user_type', 'checkbox');
$form->render('user_type', 'select');

$form->process('user_type', 'radio')
->change('select@multiple' => 'Yes')
->data;</code></pre>

<p>These are working examples (currently) and hopefully give you a visual of the
direction I'm heading in. If you feel the API for this form rendering engine is
simple and easy-to-use, thanks, this simplicity was born out of frustration and
providing this simplicity is bringing even more frustration.</p>

<p>I knew from the start I wanted to inline the templates and allow them to be
extended and overridden per instance. I started out using HTML::Zoom which is
nice but has some limitation that I wasn't willing to patch to move forward.
Some of those limitations were failure to parse simple xpaths/css-selectors,
failure to handle null and undef in a DWIM fashion, and constantly blowing-up
with difficult to trace error messages.</p>

<p>I then refactored the code to use Template::Semantic which requires XML::LibXML
which is not always the easiest to install via CPAN. Template::Semantic is great
at handling null and undef in a DWIM fashion but lacks the chainable goodness
once utilized in HTML::Zoom. Template::Semantic also doesn't die with <em>roaming</em> 
error messages. One thing that is extremely annoying is that it doesn't
automatically append pushable attributes (like class, etc), and it doesn't
create missing attribute nodes on-the-fly either. ARGGGHHH.</p>

<p>So I wrote Validation::Class::FastForm as a subclass of Template::Semantic which
uses a role that provides a chainable API and formats selectors and vars so that
they append pushable attributes and create non-existent attribute nodes. YAYYY.</p>

<p>The only problem now is every transformer is a coderef (like HTML::Zoom) which makes processing slower.</p>

<p>-Al</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Haven&apos;t Blogged in a While...</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/al_newkirk/2012/04/havent-blogged-in-a-while.html" />
    <id>tag:blogs.perl.org,2012:/users/al_newkirk//829.3087</id>

    <published>2012-04-12T00:56:37Z</published>
    <updated>2012-04-12T00:57:02Z</updated>

    <summary>... anyway, .. so today, this 11th day of the month of showers, April, 2012 the year of our Lord (take your pick), ... I&apos;ve released my latest Kracken on the world. World, meet Command::Do!...</summary>
    <author>
        <name>Al Newkirk</name>
        <uri>http://ana.im/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/al_newkirk/">
        <![CDATA[<p>... anyway, .. so today, this 11th day of the month of showers, April, 2012 the year of our Lord (take your pick), ... I've released my latest Kracken on the world.</p>
<p>World, meet <a href="https://github.com/alnewkirk/Command-Do">Command::Do</a>!</p>]]>
        
    </content>
</entry>

<entry>
    <title>Idea: Untitled - &quot;Free Meetup Service for Software Developers&quot;</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/al_newkirk/2012/03/idea-untitled---free-meetup-service-for-software-developers.html" />
    <id>tag:blogs.perl.org,2012:/users/al_newkirk//829.2992</id>

    <published>2012-03-26T06:47:24Z</published>
    <updated>2012-03-26T06:49:41Z</updated>

    <summary>Hi, I&apos;ve been thinking of developing a free meetup for developers, if interested please take this survey - http://www.surveybuilder.com/s/LKbJsWGcgAA...</summary>
    <author>
        <name>Al Newkirk</name>
        <uri>http://ana.im/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/al_newkirk/">
        <![CDATA[<p>Hi, I've been thinking of developing a free meetup for developers, if interested please take this survey - <a href="http://www.surveybuilder.com/s/LKbJsWGcgAA">http://www.surveybuilder.com/s/LKbJsWGcgAA</a></p>]]>
        
    </content>
</entry>

<entry>
    <title>CPAN as a Source for Startup Ideas</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/al_newkirk/2012/03/cpan-as-a-source-for-startup-ideas.html" />
    <id>tag:blogs.perl.org,2012:/users/al_newkirk//829.2977</id>

    <published>2012-03-22T17:24:58Z</published>
    <updated>2012-03-22T17:25:16Z</updated>

    <summary><![CDATA[I've been wanting to write this post for quite some time, while this doesn't&nbsp;explore the topic in detail it at-least gets it out of my head an into yours&nbsp;(hopefully). CPAN (the comprehensive Perl archive network) is arguably the best thing...]]></summary>
    <author>
        <name>Al Newkirk</name>
        <uri>http://ana.im/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/al_newkirk/">
        <![CDATA[<p>I've been wanting to write this post for quite some time, while this doesn't&nbsp;explore the topic in detail it at-least gets it out of my head an into yours&nbsp;(hopefully).</p>
<p></p>
<p>CPAN (the comprehensive Perl archive network) is arguably the best thing about&nbsp;the Perl programming language. CPAN is a repository of Perl software libraries.&nbsp;CPAN is also a great source for startup ideas and has the benefit of providing&nbsp;pre-developed (and usually pre-tested) code to back the venture.&nbsp;The following is a quick mashup of modules and SaaS ideas, some of which already&nbsp;exist and some of which are waiting to be created.</p>
<p></p>
<p><strong>Email-as-a-Service:&nbsp;</strong><br />This is becoming increasing popular, the concept of outsourcing email delivery.&nbsp;I myself have had a similar epiphany and thus created Email::Sender::Server. &nbsp;With&nbsp;a little effort, wrapping this library with a RESTful API, you too could&nbsp;sell subscriptions to your very own Email-as-a-Service platform and compete with&nbsp;http://www.critsend.com/, http://www.postmarkapp.com/ and others. Also, see&nbsp;ironcamel's PostMail (Perl Email REST API) at https://github.com/ironcamel/postmail.</p>
<p></p>
<p><strong>Shipping-as-a-Service:&nbsp;</strong><br />Last year I helped a Canadian develop (helped release more than code) a&nbsp;cross-courier shipping API aptly named Shipment. Having previously worked for a&nbsp;company who needed to ship different things via different couriers from a single&nbsp;app, and having been charged with the responsibility of finding a software solution&nbsp;(preferably an web service) which could handle this integration (failed), I see&nbsp;an opportunity for a much needed service. The ability to create an app&nbsp;(e.g. e-commerce, etc) and outsourcing the shipping (cost calculation, labels, etc)&nbsp;is wonderful IMHO. Does this already exist?</p>
<p></p>
<p>There are other ideas I see/have but I don't have the time to really dig-in.&nbsp;Maybe we can fill-in the blanks commenting.</p>
<p></p>
<p>-Al</p>
<div></div>]]>
        
    </content>
</entry>

</feed>
