<?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>Sukria.net</title>
	<atom:link href="http://www.sukria.net/fr/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sukria.net/fr</link>
	<description>Alexis Sukrieh&#039;s blog, mostly Perl stuff</description>
	<lastBuildDate>Sun, 14 Mar 2010 22:13:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Dancer 1.160 released</title>
		<link>http://www.sukria.net/fr/archives/2010/03/07/dancer-1-160-released/</link>
		<comments>http://www.sukria.net/fr/archives/2010/03/07/dancer-1-160-released/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 18:03:44 +0000</pubDate>
		<dc:creator>sukria</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Dancer]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://www.sukria.net/fr/?p=1485</guid>
		<description><![CDATA[A new version of Dancer has been published to CPAN a few minutes ago, it&#8217;s also available from the official website, in the download section.
As you can see, the project has now its own domain name: http://perldancer.org, it&#8217;s clearly more shiny than the previous subdomain I used ;) So feel free to update your bookmarks [...]]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://search.cpan.org/~sukria/Dancer-1.160/">new version</a> of <a href="http://perldancer.org">Dancer</a> has been published to CPAN a few minutes ago, it&#8217;s also available from the official website, in <a href="http://perldancer.org/download">the download section</a>.</p>
<p>As you can see, the project has now its own domain name: <a href="http://perldancer.org">http://perldancer.org</a>, it&#8217;s clearly more shiny than the previous subdomain I used ;) So feel free to update your bookmarks (even though the old domain name now redirects to the new one).</p>
<p>Oh, and there is also a mailing list now, for people who like to share experiences about Dancer; feel free to <a href="http://lists.perldancer.org/cgi-bin/mailman/listinfo/dancer-users">join</a>.</p>
<p>The <a href="http://cpansearch.perl.org/src/SUKRIA/Dancer-1.160/CHANGES">change set</a> for 1.160 is impressive, thanks a lot to everybody who got involved!</p>
<p>Happy dancing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sukria.net/fr/archives/2010/03/07/dancer-1-160-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>About performances</title>
		<link>http://www.sukria.net/fr/archives/2010/03/03/about-performances/</link>
		<comments>http://www.sukria.net/fr/archives/2010/03/03/about-performances/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 16:13:36 +0000</pubDate>
		<dc:creator>sukria</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Dancer]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://www.sukria.net/fr/?p=1451</guid>
		<description><![CDATA[I recently focused on Dancer&#8217;s core with a single target in mind: optimization.
After having heavily refactored the Dancer::Route class, I started benchmarking Dancer.
To start with, I&#8217;ve created a set of test applications, in order to bench different kinds of application (from a hello world app to a huge one). 
All these applications are available in [...]]]></description>
			<content:encoded><![CDATA[<p>I recently focused on Dancer&#8217;s core with a single target in mind: optimization.<br />
After having heavily refactored the Dancer::Route class, I started benchmarking Dancer.</p>
<p>To start with, I&#8217;ve created a set of test applications, in order to bench different kinds of application (from a hello world app to a huge one). </p>
<p>All these applications are available in this <a href="http://github.com/sukria/Dancer-Benchmark">repository</a>, if you like to see more precisely what I did.</p>
<p>The first test I did was to bench a &#8220;hello-world&#8221; application, with PSGI, Dancer 1.150 and the last version of the master branch. </p>
<pre style="margin: 1em;">
hello.psgi .................... 1420 req/s
hello.dancer (1.150) .......... 1260 req/s
hello.dancer (github/master) .. 1320 req/s
</pre>
<p>You can see that Dancer &#8220;master&#8221; is about 100 req/s faster than 1.150, this is mainly thanks to <a href="http://github.com/sukria/Dancer/blob/master/lib/Dancer/Route/Builder.pm">Dancer::Route::Builder</a>: Dancer now compiles all the routes defined by the application at startup time, and don&#8217;t spend time whenever a request is handled to do that job.</p>
<p>Moreover, thanks to <a href="http://blogs.perl.org/users/sawyer_x/2010/02/dancer-gets-route-caching.html">SawyerX</a>, Dancer now caches route resolution via <a href="http://github.com/sukria/Dancer/blob/master/lib/Dancer/Route/Cache.pm">Dancer::Route::Cache</a>, and that increases response-time drastically when accessing an application with lots of routes.</p>
<p>Here is another bench that I did against an application with 676 routes handlers.</p>
<pre style="margin: 1em;">
big.dancer (1.150, no cache, no route compiler) ...  110 req/s
big.dancer (GH, no cache, route compiler) .........  130 req/s
big.dancer (GH, cache, route compiler) ............ 1300 req/s
</pre>
<p>It appears clearly here that with a big number of route handlers, Dancer&#8217;s response-time decreases. I wanted to see more precisely how that occurs, and I run a bench in order to compare the response-time when varying the number of route hanlders.</p>
<p><a href="http://www.sukria.net/fr/wp-content/uploads/2010/03/dancer-bench1.png"><img src="http://www.sukria.net/fr/wp-content/uploads/2010/03/dancer-bench1.png" alt="" title="dancer-bench" width="486" height="330" class="aligncenter size-full wp-image-1467" /></a></p>
<p>As you can see on this graph, thanks to route caching, we now have a roughly constant response-time, no matter how many route handlers we have in the applicaiton.</p>
<p>These improvements will be shipped with the next CPAN version, either 1.151 or 1.160 if we have the time to add some new features as well.</p>
<p>Stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sukria.net/fr/archives/2010/03/03/about-performances/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dancer 1.150 released</title>
		<link>http://www.sukria.net/fr/archives/2010/02/17/dancer-1-150-released/</link>
		<comments>http://www.sukria.net/fr/archives/2010/02/17/dancer-1-150-released/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 17:39:00 +0000</pubDate>
		<dc:creator>sukria</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Dancer]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Release]]></category>

		<guid isPermaLink="false">http://www.sukria.net/fr/?p=1442</guid>
		<description><![CDATA[I&#8217;m happy to announce the release of Dancer 1.150.
This release has been made possible by six people, so it&#8217;s quite the first community-driven release of Dancer, and nothing could make me more happy than that.
I really like the fact that different people, from different places come and contribute ideas, documentation and patches. This is how [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m happy to announce the release of <a href="http://dancer.sukria.net">Dancer</a> <a href="http://search.cpan.org/~sukria/Dancer-1.150/">1.150</a>.</p>
<p>This release has been made possible by six people, so it&#8217;s quite the first community-driven release of Dancer, and nothing could make me more happy than that.</p>
<p>I really like the fact that different people, from different places come and contribute ideas, documentation and patches. This is how open source works, and this is how great tools are written. I&#8217;m glad to see Dancer taking that path. I can only hope that it will be like that for a long time.</p>
<p>This new version provides mostly bugfixes and documentation updates. See <a href="http://cpansearch.perl.org/src/SUKRIA/Dancer-1.150/CHANGES">the changelog</a> for full details. Oh, and thanks to <a href="http://blog.preshweb.co.uk/">David Precious</a>, we now have <a href="http://search.cpan.org/~sukria/Dancer/lib/Dancer/Cookbook.pod">a shiny Cookbook</a>!</p>
<p>Major new features will come with 1.160, but that&#8217;s for another blog entry ;)</p>
<p>Enjoy your dances.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sukria.net/fr/archives/2010/02/17/dancer-1-150-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dancer&#8217;s development update, near to release 1.140</title>
		<link>http://www.sukria.net/fr/archives/2010/02/08/dancers-development-update/</link>
		<comments>http://www.sukria.net/fr/archives/2010/02/08/dancers-development-update/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 17:40:52 +0000</pubDate>
		<dc:creator>sukria</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[The Void]]></category>
		<category><![CDATA[Dancer]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://www.sukria.net/fr/?p=1425</guid>
		<description><![CDATA[Lots of good things happened recently in Dancer&#8217;s development, here they are:
HTTP::Server::Simple::PSGI
After my last post about Dancer, Tatsuiko Miyagawa suggested to build Dancer&#8217;s standalone server upon a PSGI-aware layer, rather than on HTTP::Server::Simple::CGI.
A couple of days later, he released HTTP::Server::Simple::PSGI, which is actually based HTTP::Server::Simple (which itself doesn&#8217;t depend on any non-core modules). 
A few [...]]]></description>
			<content:encoded><![CDATA[<p>Lots of good things happened recently in Dancer&#8217;s development, here they are:</p>
<h2><code>HTTP::Server::Simple::PSGI</code></h2>
<p>After <a href="http://www.sukria.net/fr/archives/2010/02/02/dive-into-dancers-code-core-and-extensions/">my last post</a> about <a href="http://dancer.sukria.net">Dancer</a>, <a href="http://bulknews.typepad.com/">Tatsuiko Miyagawa</a> suggested to build Dancer&#8217;s standalone server upon a PSGI-aware layer, rather than on <code>HTTP::Server::Simple::CGI</code>.</p>
<p>A couple of days later, he released <a href="http://search.cpan.org/dist/HTTP-Server-Simple-PSGI/"><code>HTTP::Server::Simple::PSGI</code></a>, which is actually based <a href="http://search.cpan.org/dist/HTTP-Server-Simple/"><code>HTTP::Server::Simple</code></a> (which itself doesn&#8217;t depend on any non-core modules). </p>
<p>A few patches later, the standalone server was refactored and running on this new guy. That means when writing a Dancer app, you can now always rely on PSGI environment goodness, whereas you&#8217;re using the standalone server, or the Plack architecture. That just rocks, again kudos to <a href="http://twitter.com/miyagawa">@miyagawa</a>.</p>
<h2><code>Dancer::Request</code></h2>
<p>The <code>Dancer::Request</code> class got also heavily refactored and enhanced, it can now provide the user with an access to the raw body of the incoming request (thanks to <a href="http://github.com/RasterBurn">RasterBurn</a> for the report).</p>
<p>By the way, this class needs still so more features, and I&#8217;m actively working on it. I may release Dancer 1.2 when I&#8217;m happy with that one.</p>
<p>Oh and it also now provides a complete documentation. POD FTW.</p>
<h2><code>Dancer::Route</code></h2>
<p>I also <a href="http://github.com/sukria/Dancer/commit/75864032558c11f81fd7cf6fa4b094d41fddc730">gave a shot</a> at <code>Dancer::Route</code>, which has been recently patched to support some new features (prefix and conditional matching, thanks to <a href="http://lumberjaph.net/blog/">Frank Cuny</a>)</p>
<h2>No more <code>CGI.pm</code>, really!</h2>
<p>I also found that <code>CGI.pm</code> was still used in one very place for rendering and HTML page. This was a shame as we wanted Dancer to be 100% CGI.pm-free. Hence <a href="http://github.com/sukria/Dancer/commit/736cbbc00cdd3da88f4f3a29554a8f5d112d191c">the patch</a> that actually allow us to say it now, for REAL ;)</p>
<p>All of this freash meat is available on <a href="http://github.com/sukria/Dancer">my GitHub repo</a> and will be soon released to <a href="http://search.cpan.org/dist/Dancer/">CPAN</a>, under version 1.140. Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sukria.net/fr/archives/2010/02/08/dancers-development-update/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dive into Dancer&#8217;s code: core and extensions</title>
		<link>http://www.sukria.net/fr/archives/2010/02/02/dive-into-dancers-code-core-and-extensions/</link>
		<comments>http://www.sukria.net/fr/archives/2010/02/02/dive-into-dancers-code-core-and-extensions/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 19:15:33 +0000</pubDate>
		<dc:creator>sukria</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Dancer]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://www.sukria.net/fr/?p=1407</guid>
		<description><![CDATA[The discussion that is rising these days about frameworks and libraries reminds me I did not even take the time to talk about the last version of Dancer.
I should have, hence this post.
Last version of Dancer, 1.130, is the first version which is &#8220;plugin-aware&#8221;.
That means since 1.130 anyone can write their own template, logger or [...]]]></description>
			<content:encoded><![CDATA[<p>The discussion that is rising these days about <a href="http://stevan-little.blogspot.com/2010/02/on-frameworks.html">frameworks</a> and <a href="http://perlalchemy.blogspot.com/2010/02/frameworks-are-framing-libraries-are.html">libraries</a> reminds me I did not even take the time to talk about the last version of <a href="http://dancer.sukria.net">Dancer</a>.<br />
I should have, hence this post.</p>
<p>Last version of Dancer, <a href="http://search.cpan.org/~sukria/Dancer-1.130/">1.130</a>, is the first version which is &#8220;plugin-aware&#8221;.<br />
That means since 1.130 anyone can write their own template, logger or session engine and rock the app by just setting the appropriate value to the corresponding setting.</p>
<p>The plugins that existed before the split have been extracted from the core distribution in order to be shipped separately, that&#8217;s much clean and makes more sense that way:</p>
<ul>
<li><a href="http://search.cpan.org/dist/Dancer/">Dancer</a> : the core framework, plus essential plugins</li>
<li><a href="http://search.cpan.org/dist/Dancer-Logger-LogHandler/">Dancer::Logger::LogHandler</a> : logger engine for <a href="http://search.cpan.org/dist/Log-Handler/">Log::Handler</a> (written by <a href="http://search.cpan.org/~franckc/">Frank Cuny</a>)</li>
<li><a href="http://search.cpan.org/dist/Dancer-Template-MicroTemplate/">Dancer::Template::MicroTemplate</a> : template engine for <a href="http://search.cpan.org/dist/Text-MicroTemplate/">Text::MicroTemplate</a> (written by <a href="http://search.cpan.org/~franckc/">Frank Cuny</a>)</li>
<li><a href="http://search.cpan.org/dist/Dancer-Session-Cookie/">Dancer::Session::Cookie</a> : session engine based on encrypted cookie (written by <a href="http://search.cpan.org/~kappa/">Алексей Капранов</a>)</li>
<li><a href="http://search.cpan.org/dist/Dancer-Session-Memcached/">Dancer::Session::Memcached</a> : session engine based on memcached</li>
</ul>
<p>If you have a template, logger or session engine you&#8217;d like to see in Dancer&#8217;s ecosystem, I invite you to take a look at the corresponding interfaces you have to implement, it&#8217;s pretty straight forward.</p>
<p>The concept is pretty easy, basically, here are the steps to follow to add a new engine:</p>
<ul>
<li>choose a setting name that is available for <code>template</code>, <code>session</code> or <code>logger</code>, according to what you&#8217;re doing.
</li>
<li>implement the interface of the engine you like (Dancer::Template::Abstract, Dancer::Session::Abstract, Dancer::Logger::Abstract)</li>
<li>Name your class with a camelized version of the setting name</li>
</ul>
<p>Here is an example, let&#8217;s say you have a great template engine you&#8217;d love to use for rendering your views in your Dancer app, let&#8217;s name it &#8220;HTML::IronMark&#8221;.</p>
<ul>
<li>First of all, create Dancer::Template::Ironmark which implements the interface <a href="http://search.cpan.org/~sukria/Dancer-1.130/lib/Dancer/Template/Abstract.pm">Dancer::Template::Abstract</a></li>
<li>Then change the setting <code>template</code> to <code>"ironmark"</code></li>
</ul>
<p>And well, you&#8217;re done. This is pretty much the same job for logger and session engines.</p>
<p>Feel free to <a href="http://dancer.sukria.net/about">contact me</a> if you want to write your own and need more precisions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sukria.net/fr/archives/2010/02/02/dive-into-dancers-code-core-and-extensions/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Back to the goban</title>
		<link>http://www.sukria.net/fr/archives/2010/01/25/back-to-the-goban/</link>
		<comments>http://www.sukria.net/fr/archives/2010/01/25/back-to-the-goban/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 11:16:58 +0000</pubDate>
		<dc:creator>sukria</dc:creator>
				<category><![CDATA[The Void]]></category>
		<category><![CDATA[Go]]></category>
		<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.sukria.net/fr/?p=1397</guid>
		<description><![CDATA[
A black stone hitting the wood.
A white stone is dead.
But shall the black group live for long?
Fear the Tesuji!


Ah, I&#8217;m glad I&#8217;ll face a goban this evening, it&#8217;s been too long!
]]></description>
			<content:encoded><![CDATA[<p><em><br />
A black stone hitting the wood.<br />
A white stone is dead.<br />
But shall the black group live for long?<br />
Fear the Tesuji!<br />
</em></p>
<p><a href="http://www.sukria.net/fr/wp-content/uploads/2010/01/go1.jpg"><img src="http://www.sukria.net/fr/wp-content/uploads/2010/01/go1.jpg" alt="goban" width="450" height="237" class="aligncenter size-full wp-image-1398" /></a></p>
<p>Ah, I&#8217;m glad I&#8217;ll face a goban this evening, it&#8217;s been too long!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sukria.net/fr/archives/2010/01/25/back-to-the-goban/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PSGI/Plack the ultimate Perl Web Server</title>
		<link>http://www.sukria.net/fr/archives/2010/01/22/psgiplack-the-ultimate-perl-web-server/</link>
		<comments>http://www.sukria.net/fr/archives/2010/01/22/psgiplack-the-ultimate-perl-web-server/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 11:26:25 +0000</pubDate>
		<dc:creator>sukria</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Perl Web Server]]></category>
		<category><![CDATA[Plack]]></category>

		<guid isPermaLink="false">http://www.sukria.net/fr/?p=1394</guid>
		<description><![CDATA[Google has to realize like we all do, that Plack is the utlimate Perl Web Server.
The first slot will be hard to reach though, because of that sourceforge page which has &#8220;perlwebserver&#8221; in its hostname.
]]></description>
			<content:encoded><![CDATA[<p>Google has to realize like we all do, that <a href="http://plackperl.org">Plack</a> is the utlimate <a href="http://plackperl.org">Perl Web Server</a>.</p>
<p>The first slot will be hard to reach though, because of that sourceforge page which has &#8220;perlwebserver&#8221; in its hostname.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sukria.net/fr/archives/2010/01/22/psgiplack-the-ultimate-perl-web-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting rid of CGI.pm in Dancer&#8217;s code</title>
		<link>http://www.sukria.net/fr/archives/2010/01/16/getting-rid-of-cgi-pm-in-dancers-code/</link>
		<comments>http://www.sukria.net/fr/archives/2010/01/16/getting-rid-of-cgi-pm-in-dancers-code/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 16:57:33 +0000</pubDate>
		<dc:creator>sukria</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Dancer]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Plack]]></category>

		<guid isPermaLink="false">http://www.sukria.net/fr/?p=1389</guid>
		<description><![CDATA[Yes, I finally took the decision to stop using CGI.pm in Dancer&#8217;s code. It was not an easy decision to take, mainly because of the following reasons:

it&#8217;s in the core (I&#8217;m a &#8220;less-CPAN-deps-ships-better&#8221; freak when it&#8217;s about Dancer!)

it provides a stable and well-known way of dealing with the HTTP interface (params, methods, path infos &#8230;)

and [...]]]></description>
			<content:encoded><![CDATA[<p>Yes, I finally took the decision to stop using CGI.pm in <a href="http://github.com/sukria/Dancer">Dancer</a>&#8217;s code. It was not an easy decision to take, mainly because of the following reasons:</p>
<ul>
<li>it&#8217;s in the core (I&#8217;m a &#8220;less-CPAN-deps-ships-better&#8221; freak when it&#8217;s about Dancer!)
</li>
<li>it provides a stable and well-known way of dealing with the HTTP interface (params, methods, path infos &#8230;)
</li>
<li>and well, to add a third reason, why should I want to change it if it works?
</li>
</ul>
<p>Well, actually, we did find a bug recently in CGI::PSGI that prevented a Dancer app from being deployed under Plack::Server::Apache2. Oh, of course, the bug was almost instantly fixed when it has been discovered (the #plack people are really reactive). </p>
<p>But that enlightened something: CGI.pm is old, really old, and that means, when you&#8217;re using it, you take with you a lots of lines of code coming from years ago. Moreover it is well known that CGI.pm does addresses different matters, such as providing a request interface and generating HTML content as well. Conceptually, it sucks.</p>
<p>After thinking about all that, I decided to drop CGI.pm out of Dancer&#8217;s code. I then have the option to use the pretty fresh <a href="http://search.cpan.org/dist/Plack-Request/">Plack::Request</a> interface. It looks really nice and does exactly what you can expect from it.</p>
<p>But, it&#8217;s important for me that Dancer can be used without Plack. I want the dependency barrier to be as low as possible:<br />
If a user wants to test Dancer, he should not have to install Plack in my opinion. If he likes it, and wants to goes on production, then yes, Plack is a must-go. He then installs Plack and goes on with Dancer&#8217;s app.psgi.</p>
<p>So depending on Plack::Request was one more dependency I&#8217;d rather not add to Dancer.</p>
<p>With all this in mind I came to the decision to write Dancer::Request, reading carefully the <a href="http://search.cpan.org/dist/PSGI/">PSGI specs</a> (miyagawa++ again).</p>
<p>It was all good except for processing the POST data. There&#8217;s so much work to do when it&#8217;s about multipart form, url-encoded form, or even file uploads that I chose not to push the &#8220;reinvent-the-wheel&#8221; thing too far, and I decided to copycat Plack::Request on this topic: using HTTP::Body.</p>
<p>This module does the job pretty well, with an object-oriented interface.</p>
<p>The conclusion might look like a failure (I rewrote something that worked by adding a new dependecy.) But deep inside I&#8217;m happy with this refactoring; because Dancer is now on a way where all of its code will be fresh, based on PSGI specs and won&#8217;t ever rely on CGI.pm to do something.</p>
<p>I hope Dancer&#8217;s users/developers will agree with that. feel free to comment on this post if you want to share your point of views. Yes, I know this might trigger a troll or two&#8230; ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sukria.net/fr/archives/2010/01/16/getting-rid-of-cgi-pm-in-dancers-code/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Using Plack to run a Dancer app under a CGI environment</title>
		<link>http://www.sukria.net/fr/archives/2010/01/11/using-plack-to-run-a-dancer-app-under-a-cgi-environment/</link>
		<comments>http://www.sukria.net/fr/archives/2010/01/11/using-plack-to-run-a-dancer-app-under-a-cgi-environment/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 17:43:04 +0000</pubDate>
		<dc:creator>sukria</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[CGI]]></category>
		<category><![CDATA[Dancer]]></category>
		<category><![CDATA[Plack]]></category>

		<guid isPermaLink="false">http://www.sukria.net/fr/?p=1373</guid>
		<description><![CDATA[Sawyer X on blogs.perl.org recently wondered how one could run a Dancer application under a 100% CGI environment. 
Indeed, he came up quickly with a REST app in development stage and wanted to go on air with a plain old CGI script. He seems to think it&#8217;s not possible with Dancer but as Dancer supports [...]]]></description>
			<content:encoded><![CDATA[<p>Sawyer X on blogs.perl.org recently <a href="http://blogs.perl.org/users/sawyer_x/2010/01/i-gotz-me-a-dancer.html">wondered</a> how one could run a Dancer application under a 100% CGI environment. </p>
<p>Indeed, he came up quickly with a REST app in development stage and wanted to go on air with a plain old CGI script. He seems to think it&#8217;s not possible with Dancer but as Dancer supports PSGI/Plack, he&#8217;s wrong ;)</p>
<p>Thanks to the PSGI/Plack goodness, any application can be powered by a Plack-supported server. CGI is one of them and is implemented by <a href="http://search.cpan.org/~miyagawa/Plack-0.9030/lib/Plack/Server/CGI.pm">Plack::Server::CGI</a>. </p>
<p>By taking a quick look at the POD, we see that all we have to do is to write a pretty simple CGI script to bridge the Dancer app with Apache:</p>
<pre class="prettyprint">
#!/usr/bin/perl

use Plack::Server::CGI;
use Plack::Util;

my $psgi = '/path/to/your/app/app.psgi';
my $app = Plack::Util::load_psgi($psgi);
Plack::Server::CGI->new->run($app);
</pre>
<p>We now have to tell Apache that everything should be dispatched to that very CGI script like the following:</p>
<pre class="prettyprint">
&lt;VirtualHost ....&gt;
	&lt;Directory "/path/to/your/app"&gt;
		AllowOverride None
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
		AddHandler cgi-script .cgi
	&lt;/Directory&gt;

	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteRule ^(.*)$ /dancer.cgi [QSA,L]

        [...]
&lt;/VirtualHost&gt;
</pre>
<p>And&#8230; we&#8217;re done! Every request the Apache server catches is now served by Dancer through Plack::Server::CGI</p>
<p>All I have to say here is &#8230; <a href="http://plackperl.org">Plack</a>++ (or <a href="http://twitter.com/miyagawa">@miyagawa</a>++ which seems to be the same ;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sukria.net/fr/archives/2010/01/11/using-plack-to-run-a-dancer-app-under-a-cgi-environment/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Dancer 1.100 released</title>
		<link>http://www.sukria.net/fr/archives/2010/01/06/dancer-1-100-released/</link>
		<comments>http://www.sukria.net/fr/archives/2010/01/06/dancer-1-100-released/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 17:35:08 +0000</pubDate>
		<dc:creator>sukria</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[CPAN]]></category>
		<category><![CDATA[Dancer]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Release]]></category>

		<guid isPermaLink="false">http://www.sukria.net/fr/?p=1368</guid>
		<description><![CDATA[A new version of Dancer has just been published on CPAN. It was a good time to do it, according to the changelog, as you can see:

    * Support for multiple method routes at once with 'any'
    * Templates engines
      + Bug fixes in [...]]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://search.cpan.org/~sukria/Dancer-1.100/">new version</a> of <a href="http://dancer.sukria.net">Dancer</a> has just been published on CPAN. It was a good time to do it, according to the changelog, as you can see:</p>
<pre>
    * Support for multiple method routes at once with 'any'
    * Templates engines
      + Bug fixes in Dancer::Template::Simple (Jury Gorky)
      + Refactoring of the factory
      + option for disabling the layout in the template helper.
    * New session engine based on encrypted cookies (Alex Kapranof)
    * More HTTP codes supported for a better REST compat (Nate Jones)
    * Documentation updates
    * script/dancer now requires an appname
    * New Makefile.PL with better metadata (CPAN Service)
</pre>
<p>I&#8217;m pretty glad to underline that this release is the first one where most of the changes are written by other developers than me, that&#8217;s really exciting to see more and more people involved with the project. </p>
<p>This release should also fix the test-suite which looks to be broken on most of the CPAN testers under version 1.000 (but sadly not on my workstation, so I wasn&#8217;t aware of it).</p>
<p><b>UPDATE Jan. 7th 2010</b> : <a href="http://static.cpantesters.org/distro/D/Dancer.html#1.100">The CPAN-testers reports</a> show that 1.100 passes 100% of the tests under Linux and FreeBSD, that&#8217;s a good start!<br />
<a href="http://twitter.com/sukria">Stay tuned for next dances</a>! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sukria.net/fr/archives/2010/01/06/dancer-1-100-released/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
