[Catalyst-commits] r8824 - trunk/examples/CatalystAdvent/root/2008

zarquon at dev.catalyst.perl.org zarquon at dev.catalyst.perl.org
Thu Dec 11 11:26:36 GMT 2008


Author: zarquon
Date: 2008-12-11 11:26:36 +0000 (Thu, 11 Dec 2008)
New Revision: 8824

Modified:
   trunk/examples/CatalystAdvent/root/2008/10.pod
Log:
more minor edits to 10.pod - what you get for an emergency advent article before morning coffee

Modified: trunk/examples/CatalystAdvent/root/2008/10.pod
===================================================================
--- trunk/examples/CatalystAdvent/root/2008/10.pod	2008-12-11 10:42:39 UTC (rev 8823)
+++ trunk/examples/CatalystAdvent/root/2008/10.pod	2008-12-11 11:26:36 UTC (rev 8824)
@@ -2,10 +2,10 @@
 
 Today's recipe is very quick and simple, but scratches a minor
 irritation. L<Config::General> (Apache-style), the default
-configuration file format for Catalyst, is great for readability,
-and the ease with which non-programmers can modify it.  However, it
-doesn't deal with single item arrays well. That is, suppose you have the
-following configuration:
+configuration file format for Catalyst, is great for readability, and
+the ease with which non-programmers can modify it.  However, it
+doesn't deal with single item arrays well. That is, suppose you have
+the following configuration:
 
  <some_values>
  want_an_array some data
@@ -17,7 +17,8 @@
 
 results in the output C< some data >.
 
-One way of fixing this is to just provide spurious extra keys in the config file:
+One way of fixing this is to just provide spurious extra keys in the
+config file:
 
  <some_values>
  want_an_array some data
@@ -32,22 +33,23 @@
 =head2 When it absolutely has to be an array and needs to be able to have a length of 1.
 
 Unfortunately this is not entirely satisfactory, as sometimes you're
-using a plugin that requires an arrayref even with only one item (and it
-can't be bogus without leading to problems), or if need to know the
-length of the array without cumbersome workarounds. Enter L<Moose>:
+using a plugin that requires an arrayref even with only one item (and
+subsequent entries can't be bogus without leading to problems), or if
+need to know the length of the array without cumbersome
+workarounds. Enter L<Moose>:
 
- use Moose;
  after 'setup' => sub {
      use Moose::Autobox;
      $_[0]->config->{some_values}{want_an_array} = [ $_[0]->config->{some_values}{want_an_array}->flatten ];
  };
- no Moose;
 
-Place this solution in MyApp.pm and the problem is fixed!
+Place this solution in MyApp.pm (it's just a normal subroutine with
+some Moose style syntax around it), and the problem is fixed!
 
 =head1 ACKNOWLEDGEMENTS
 
-Matt Trout (for the code), Jesse Sheidlower (for getting the code out of Matt finally)
+Matt Trout (for the code), Jesse Sheidlower (for getting the code out
+of Matt finally)
 
 =head1 AUTHOR
 




More information about the Catalyst-commits mailing list