<?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>netCUBED Blog &#187; Perl</title>
	<atom:link href="http://blog.netcubed.de/tag/perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.netcubed.de</link>
	<description>Just another web developer's weblog</description>
	<lastBuildDate>Mon, 29 Jun 2009 20:58:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Test for &#8220;forbidden&#8221; words?</title>
		<link>http://blog.netcubed.de/2009/06/test-for-forbidden-words/</link>
		<comments>http://blog.netcubed.de/2009/06/test-for-forbidden-words/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 20:53:15 +0000</pubDate>
		<dc:creator>Moritz Onken</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[forbidden words]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://blog.netcubed.de/?p=88</guid>
		<description><![CDATA[I&#8217;m developing a web app right now and as some of you might know there is a very popular javascript command which is used for debugging. It&#8217;s invoked via console.log() and takes anything as an argument. If you use Firefox with Firebug or Safari 4 the value you pass to console.log will be printed and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m developing a web app right now and as some of you might know there is a very popular javascript command which is used for debugging. It&#8217;s invoked via <code>console.log()</code> and takes anything as an argument. If you use Firefox with Firebug or Safari 4 the value you pass to <code>console.log</code> will be printed and introspected via a debug window.</p>
<p>The problem is that I forget on a regular basis to remove those <code>console.log</code> statements. I wrote a very quick and dirty perl script which searches files with  an .js extension for console.log. I put that script in the t/ folder and named it <code>forbidden_words.t</code>.</p>
<p>It works great so far and my test suite fails as soon as there is still a console.log around. I plan to extend this script to something like Test::ForbiddenWords or something where you can specify file extensions and strings (or regexes).</p>
<p>I couldn&#8217;t find anything like this on the CPAN, so give me a comment if you like the idea or know something better.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.netcubed.de/2009/06/test-for-forbidden-words/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Devel::IntelliPerl released on an unsuspecting world.</title>
		<link>http://blog.netcubed.de/2009/06/develintelliperl-released-on-an-unsuspecting-world/</link>
		<comments>http://blog.netcubed.de/2009/06/develintelliperl-released-on-an-unsuspecting-world/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 14:52:29 +0000</pubDate>
		<dc:creator>Moritz Onken</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[code completion]]></category>
		<category><![CDATA[devel]]></category>
		<category><![CDATA[intelliperl]]></category>

		<guid isPermaLink="false">http://blog.netcubed.de/?p=132</guid>
		<description><![CDATA[I managed to pack my work on code completion to a distribution and released it to the CPAN. The source code is managed on github. Use it, watch it, fork it, break it, fix it, patch it &#8230; you know the game!
Watch the demo for new features (no audio).
So what is missing?
It would be great [...]]]></description>
			<content:encoded><![CDATA[<p>I managed to pack my work on code completion to a distribution and released it to the <a href="http://search.cpan.org/perldoc?Devel::IntelliPerl" target="_blank">CPAN</a>. The source code is managed on <a href="http://github.com/monken/Devel-IntelliPerl/tree/master" target="_blank">github</a>. Use it, watch it, fork it, break it, fix it, patch it &#8230; you know the game!</p>
<p>Watch the demo for new features (no audio).</p>
<span class='flash'><span id='flash-develintelliperl-released-on-an-unsuspecting-world2.41863422437E+32'></span></span>
<script type='text/javascript'>
var params = {
allowfullscreen: 'true'
};var flashvars = null
swfobject.embedSWF('http://blog.netcubed.de/wp-content/uploads/2009/06/00000005.swf', 'flash-develintelliperl-released-on-an-unsuspecting-world2.41863422437E+32', '500', '293', '9.0.0', '', flashvars, params, '');
</script>
<p>So what is missing?<br />
It would be great if code completion works for chained method calls:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># DateTime</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$dt</span> <span style="color: #339933;">=</span> DateTime<span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #009900;">&#40;</span>year <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">2009</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$dt</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">add</span><span style="color: #009900;">&#40;</span> months <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span>_  <span style="color: #666666; font-style: italic;"># we are still a DateTime object!</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># in a DBIC environment</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$rs</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$schema</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">resultset</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Foo'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span>_ <span style="color: #666666; font-style: italic;"># we get a MySchema::ResultSet::Foo</span></pre></div></div>

<p>What we need is a way to define the return values of methods. Moose&#8217;s type system is not much of a help because you cannot introspect what class is behind a custom type.</p>
<p>I was thinking about an IntelliPerl profile which is stored in the home directory as well as in each project. Those two are merged and define method signatures and variable types.</p>
<p>Possible syntax:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># ~/.intelliperl</span>
<span style="color: #0000ff;">$schema</span> isa DBIx<span style="color: #339933;">::</span><span style="color: #006600;">Class</span><span style="color: #339933;">::</span><span style="color: #006600;">Schema</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$rs</span> isa DBIx<span style="color: #339933;">::</span><span style="color: #006600;">Class</span><span style="color: #339933;">::</span><span style="color: #006600;">ResultSet</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$dt</span> isa DateTime<span style="color: #339933;">;</span>
&nbsp;
method DBIx<span style="color: #339933;">::</span><span style="color: #006600;">Class</span><span style="color: #339933;">::</span><span style="color: #006600;">ResultSet</span><span style="color: #339933;">::</span><span style="color: #006600;">search</span> returns DBIx<span style="color: #339933;">::</span><span style="color: #006600;">Class</span><span style="color: #339933;">::</span><span style="color: #006600;">ResultSet</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># ~/workspace/MyApp/.intelliperl</span>
&nbsp;
<span style="color: #0000ff;">$schema</span> isa MyApp<span style="color: #339933;">::</span><span style="color: #006600;">Model</span><span style="color: #339933;">::</span><span style="color: #006600;">DBIC</span>
<span style="color: #0000ff;">$rs</span> isa MyApp<span style="color: #339933;">::</span><span style="color: #006600;">Schema</span><span style="color: #339933;">::</span><span style="color: #006600;">ResultSet</span></pre></div></div>

<p>A different approach would be to add the method signature to the POD:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">&nbsp;
<span style="color: #666666; font-style: italic;">=head2 mymethod
&nbsp;
=for intelliperl
method mymethod ($dt DateTime) returns DateTime</span></pre></div></div>

<p>This will make <code>$dt</code> inside mymethod a DateTime variable and the returned value is a DateTime object as well.</p>
<p>For now only <a href="http://search.cpan.org/perldoc?Devel::IntelliPerl::Editor::TextMate" target="_blank">TextMate</a> is supported. See the documentation for details.</p>
<p>I&#8217;d love to see more Devel::IntelliPerl::Editor::s!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.netcubed.de/2009/06/develintelliperl-released-on-an-unsuspecting-world/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Perl autocompletion of methods for TextMate</title>
		<link>http://blog.netcubed.de/2009/06/perl-autocompletion-of-methods-for-textmate/</link>
		<comments>http://blog.netcubed.de/2009/06/perl-autocompletion-of-methods-for-textmate/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 08:26:01 +0000</pubDate>
		<dc:creator>Moritz Onken</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[auto completion]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[completion]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://blog.netcubed.de/?p=120</guid>
		<description><![CDATA[It is pretty hard to write a code completion script for perl since it&#8217;s hard to find out of which type a variable is. I use simple regexes and a comment to achieve this. Here is how it looks like:
It consists of a perl script which reads the current file from STDIN and gets the [...]]]></description>
			<content:encoded><![CDATA[<span class='flash'><span id='flash-perl-autocompletion-of-methods-for-textmate1.58507612528E+37'></span></span>
<script type='text/javascript'>
var params = {
allowfullscreen: 'true'
};var flashvars = null
swfobject.embedSWF('http://blog.netcubed.de/wp-content/uploads/2009/06/2009-06-10_1002.swf', 'flash-perl-autocompletion-of-methods-for-textmate1.58507612528E+37', '574', '474', '9.0.0', '', flashvars, params, '');
</script>
<p>It is pretty hard to write a code completion script for perl since it&#8217;s hard to find out of which type a variable is. I use simple regexes and a comment to achieve this. Here is how it looks like:</p>
<p>It consists of a perl script which reads the current file from STDIN and gets the current line number as well as the cursor position in that line. The script is run if the cursor is behind a <code>-&gt;</code> and the string before that looks like a class or a variable. If it&#8217;s a variable the script travels the lines up until it finds something like <code>$var = Class->new</code>, <code>$var = new Class</code> or <code> # $var isa Class</code>.</p>
<p><code>Class::MOP::Class</code> loads that class and retrieves all method names. It also evaluates the prefix which has been entered behind the <code>-></code> and displays those methods only which have the same prefix. Private methods are moved to the buttom as well as capitalized method names.</p>
<p>The second part of this script is embedded in TextMate. TextMate allows to define custom commands. You can define how the data shoud be rendered depending on the return value of the script. In this case STDERR is printed directly into the editor (if there is only one method left) and STDOUT is printed as tool tip.</p>
<p>I&#8217;d like to hear what you think about it and whether there are better / other approaches. I should probably use PPI instead of regexes to parse the document. This is one of the reasons why I did not release any code yet. Another shortcoming is speed. Especially for large classes like Catalyst or DateTime it takes a noticeable time until you get the results.</p>
<p>So long&#8230; I&#8217;ll keep you posted.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.netcubed.de/2009/06/perl-autocompletion-of-methods-for-textmate/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Format JavaScript in TextMate with JavaScript::Beautifier</title>
		<link>http://blog.netcubed.de/2009/06/format-javascript-in-textmate-with-javascriptbeautifier/</link>
		<comments>http://blog.netcubed.de/2009/06/format-javascript-in-textmate-with-javascriptbeautifier/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 17:08:53 +0000</pubDate>
		<dc:creator>Moritz Onken</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://blog.netcubed.de/?p=104</guid>
		<description><![CDATA[TextMate has a number of great bundles which help you develop in many many languages. The feature I miss most is formatting for JavaScript just like Perl Tidy does it for Perl.
I recently saw JavaScript::Beautifier in the &#8220;Recent&#8221; list on the CPAN and was wondering if I can bind it to TextMate. This is how [...]]]></description>
			<content:encoded><![CDATA[<p>TextMate has a number of great bundles which help you develop in many many languages. The feature I miss most is formatting for JavaScript just like Perl Tidy does it for Perl.</p>
<p>I recently saw <a href="http://search.cpan.org/perldoc?JavaScript::Beautifier">JavaScript::Beautifier</a> in the &#8220;Recent&#8221; list on the CPAN and was wondering if I can bind it to TextMate. This is how I did it:</p>
<p>First of all, install it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> cpan <span style="color: #660033;">-i</span> JavaScript::Beautifier</pre></div></div>

<p>Next, add the command to TextMate. Open the Bundle Editor (Bundles/Bundle Editor/Show Bundle Editor).</p>
<p style="text-align: center;"><img class="size-full wp-image-106   aligncenter" title="bild-1" src="http://blog.netcubed.de/wp-content/uploads/2009/06/bild-1.png" alt="bild-1" width="267" height="161" /></p>
<p style="text-align: left; clear:both">Then select JavaScript and click on &#8220;New Command&#8221; (bottom left).<img class="size-medium wp-image-107   aligncenter" title="bild-2" src="http://blog.netcubed.de/wp-content/uploads/2009/06/bild-2-300x220.png" alt="bild-2" width="300" height="220" /></p>
<p style="text-align: left; clear:both">Name it &#8220;Beautifier&#8221; (or whatever you want) and paste the following in the command text field:</p>
<pre>require_cmd js_beautify.pl 'sudo cpan -i JavaScript::Beautifier'

js_beautify.pl $TM_FILEPATH</pre>
<p>Set the rest of the options like this:</p>
<pre style="text-align: center;"><img class="size-full wp-image-108" title="bild-3" src="http://blog.netcubed.de/wp-content/uploads/2009/06/bild-3.png" alt="bild-3" width="457" height="466" /></pre>
<p>Now you are ready to go! Open up a JavaScript document and hit Shift+Crtl+H and the current document should be formatted.</p>
<p style="text-align: center;"><img class="size-full wp-image-105   aligncenter" title="bild-9" src="http://blog.netcubed.de/wp-content/uploads/2009/06/bild-9.png" alt="bild-9" width="234" height="134" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.netcubed.de/2009/06/format-javascript-in-textmate-with-javascriptbeautifier/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dispatch Catalyst log output to Growl</title>
		<link>http://blog.netcubed.de/2009/05/dispatch-catalyst-log-output-to-growl/</link>
		<comments>http://blog.netcubed.de/2009/05/dispatch-catalyst-log-output-to-growl/#comments</comments>
		<pubDate>Sun, 10 May 2009 17:02:15 +0000</pubDate>
		<dc:creator>Moritz Onken</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[catalyst]]></category>
		<category><![CDATA[growl]]></category>
		<category><![CDATA[notification]]></category>

		<guid isPermaLink="false">http://blog.netcubed.de/?p=74</guid>
		<description><![CDATA[Growl is a nice notification utility for Mac OS X. There are many applications or plugins avaiable which interact with Growl (e. g. Skype, Mail, VLC etc.).
I thought it would be nice if I could redirect the catalyst debug output to it as well. Log::Dispatch has a nice appender Log::Dispatch::MacGrowl. Load Log::Dispatch as plugin in [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-76" title="My App Growls" src="http://blog.netcubed.de/wp-content/uploads/2009/05/bild-5-300x126.png" alt="My App Growls" width="300" height="126" /><a href="http://growl.info/" target="_blank">Growl</a> is a nice notification utility for Mac OS X. There are many applications or plugins avaiable which interact with Growl (e. g. Skype, Mail, VLC etc.).</p>
<p>I thought it would be nice if I could redirect the catalyst debug output to it as well. Log::Dispatch has a nice appender <a href="http://search.cpan.org/perldoc?Log::Dispatch::MacGrowl" target="_blank">Log::Dispatch::MacGrowl</a>. Load Log::Dispatch as plugin in MyApp.pm (after ConfigLoader):</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">use</span> Catalyst <span style="color: #000066;">qw</span><span style="color: #339933;">/-</span>Debug
                ConfigLoader
                Log<span style="color: #339933;">::</span><span style="color: #006600;">Dispatch</span>
                Static<span style="color: #339933;">::</span><span style="color: #006600;">Simple</span><span style="color: #339933;">/;</span></pre></div></div>

<p>and configure your app accordingly:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Log::Dispatch<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	class     = MacGrowl
	name      = growl
	app_name  = MyAppGrowls
	title     = MyApp
	sticky    = 0
	min_level = notice
	format    = [%p] %m %n
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Log::Dispatch<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>I cannot recommend to set <code>min_level</code> to <code>info</code> or below because this will add all start up log statements to be rendered on your screen. Kind of annoying.</p>
<p>Put a log statement anywhere in your code and start up your dev server. A growl notification should appear when you hit the log statement.</p>
<p>You can get a sample application <code>MyAppGrowls</code> from <a href="http://github.com/monken/MyAppGrowls/tree/master" target="_blank">GitHub</a>.</p>
<p>Make sure you have the following modules installed (or run <code>perl Makefile.PL</code>):</p>
<ul>
<li>Catalyst::Plugin::Log::Dispatch</li>
<li>Log::Dispatch::Config</li>
<li>Log::Dispatch::MacGrowl</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.netcubed.de/2009/05/dispatch-catalyst-log-output-to-growl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pod::Browser, yet another pod viewer</title>
		<link>http://blog.netcubed.de/2009/05/podbrowser-yet-another-pod-viewer/</link>
		<comments>http://blog.netcubed.de/2009/05/podbrowser-yet-another-pod-viewer/#comments</comments>
		<pubDate>Mon, 04 May 2009 22:27:04 +0000</pubDate>
		<dc:creator>Moritz Onken</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[catalyst]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[pod]]></category>
		<category><![CDATA[viewer]]></category>

		<guid isPermaLink="false">http://blog.netcubed.de/?p=44</guid>
		<description><![CDATA[Writing documentation is sometimes hard but inevitable. If you write code which is published on the CPAN you can always access the documentation through search.cpan.org. For those cases where you cannot publish your code on the CPAN it would be great if you had a web site like CPAN where you can access the documentation. For [...]]]></description>
			<content:encoded><![CDATA[<p>Writing documentation is sometimes hard but inevitable. If you write code which is published on the CPAN you can always access the documentation through search.cpan.org. For those cases where you cannot publish your code on the CPAN it would be great if you had a web site like CPAN where you can access the documentation. For this reason I wrote Pod::Browser a while back. <a href="http://search.cpan.org/perldoc?Pod::Browser" target="_blank">Pod::Browser</a> is a browser for all your local modules and all the modules from the CPAN. The interface is rendered by ExtJS, a powerful JavaScript framework.</p>
<div><a href="http://cpan.org/authors/id/P/PE/PERLER/pod-images/pod-encyclopedia-01.png" target="_blank"><img src="http://cpan.org/authors/id/P/PE/PERLER/pod-images/pod-encyclopedia-01.png" alt="Pod::Browser" width="400" /></a></div>
<p>After installing Pod::Browser and running the server (pod_browser_server.pl) you should be able to access the browser via http://localhost:3000. On the right hand side of the page is a tree which contains all the modules installed on your system. The main page contains a search box where you can search the CPAN via it&#8217;s XML interface. If you open a module which is also installed on your system, the local pod will be served. Otherwise the pod is read from the CPAN. Each module has its own ExtJS tab. This allows to have multiple documents open at the same time in a single browser window. The table of contents is shown in the upper left panel.</p>
<p>Since this browser has been implemented as a single Catalyst controller, you can simply create an empty controller in your application and use Catalyst::Controller::POD as base class:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #000066;">package</span> MyApp<span style="color: #339933;">::</span><span style="color: #006600;">Controller</span><span style="color: #339933;">::</span><span style="color: #006600;">Docs</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">use</span> warnings<span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">use</span> base <span style="color: #ff0000;">'Catalyst::Controller::POD'</span><span style="color: #339933;">;</span>
  __PACKAGE__<span style="color: #339933;">-&gt;</span><span style="color: #006600;">config</span><span style="color: #009900;">&#40;</span>
    inc        <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
    namespaces <span style="color: #339933;">=&gt;</span> <span style="color: #009900;">&#91;</span><span style="color: #000066;">qw</span><span style="color: #009900;">&#40;</span>Catalyst<span style="color: #339933;">::</span><span style="color: #006600;">Manual</span><span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
    self       <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
  <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span></pre></div></div>

<p>This will make the documentation to your application avaiable from /docs. The pod tree will also contain all the modules which are listed in the namespaces config attribute (in this case Catalyst::Manual).</p>
<p>For more information on <a href="http://search.cpan.org/perldoc?Pod::Browser" target="_blank">Pod::Browser</a> and <a href="http://search.cpan.org/perldoc?Catalyst::Controller::POD" target="_blank">Catalyst::Controller::POD</a> please read the documentation on the CPAN.</p>
<p><strong>Warning:</strong></p>
<p>If you set inc to 1 and leave the namespaces parameter blank it can take a while until all modules are indexed and presented in your browser. Be either patient or restrict the namespace to a sane subset of your modules.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.netcubed.de/2009/05/podbrowser-yet-another-pod-viewer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CPAN: Test::MockTime, Time Saver!</title>
		<link>http://blog.netcubed.de/2009/04/cpan-testmocktime-time-saver/</link>
		<comments>http://blog.netcubed.de/2009/04/cpan-testmocktime-time-saver/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 13:17:39 +0000</pubDate>
		<dc:creator>Moritz Onken</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[cpan]]></category>
		<category><![CDATA[mock]]></category>
		<category><![CDATA[mocktime]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://blog.netcubed.de/?p=31</guid>
		<description><![CDATA[I recently had to test my model which has a method which depends on DateTime-&#62;now. The problem with testing is, that the returned value will change depending on the current time.
I could have copied the logic from the model&#8217;s method but that would have made the test obsolete. Instead I choose to mock the current [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to test my model which has a method which depends on DateTime-&gt;now. The problem with testing is, that the returned value will change depending on the current time.</p>
<p>I could have copied the logic from the model&#8217;s method but that would have made the test obsolete. Instead I choose to mock the current time and looked for a proper module on CPAN. And was lucky: <a href="http://search.cpan.org/perldoc?Test::MockTime">Test::MockTime</a> does just what I want:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">use</span> Test<span style="color: #339933;">::</span><span style="color: #006600;">MockTime</span> <span style="color: #000066;">qw</span><span style="color: #009900;">&#40;</span>set_absolute_time<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
set_absolute_time<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'2009-04-24T00:00:00Z'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>And that&#8217;s it!</p>
<p>But make shure you load modules like DateTime <strong>after</strong> Test::MockTime!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.netcubed.de/2009/04/cpan-testmocktime-time-saver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Restore Perl on Leopard</title>
		<link>http://blog.netcubed.de/2009/01/how-to-restore-perl-on-leopard/</link>
		<comments>http://blog.netcubed.de/2009/01/how-to-restore-perl-on-leopard/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 16:34:52 +0000</pubDate>
		<dc:creator>Moritz Onken</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[restore]]></category>

		<guid isPermaLink="false">http://blog.netcubed.de/?p=26</guid>
		<description><![CDATA[I recently created a Repo at Github.com. Since I already had MacPorts up and running on my Mac I ran sudo port install git-core to install git.
Unfortunately it also installed the perl58 package which replaced Apple&#8217;s Perl. The new perl was installed to /opt/lib/perl and @INC included those directories only. All modules I had previously [...]]]></description>
			<content:encoded><![CDATA[<p>I recently created a <a href="https://github.com/monken/laden/tree" target="_blank">Repo</a> at Github.com. Since I already had MacPorts up and running on my Mac I ran <code>sudo port install git-core</code> to install git.</p>
<p>Unfortunately it also installed the perl58 package which replaced Apple&#8217;s Perl. The new perl was installed to <code>/opt/lib/perl</code> and @INC included those directories only. All modules I had previously installed in /Library/Perl. I decided to install Perl again to have the old behaviour again.</p>
<p>I followed <a href="http://developer.apple.com/internet/opensource/perl.html">this old guide</a> by Apple and adopted it to Perl 5.8.8.</p>
<p><code><br />
wget ftp://ftp.cpan.org/pub/CPAN/src/perl-5.8.8.tar.gz<br />
tar zxvf perl-5.8.8.tar.gz<br />
cd perl-5.8.8<br />
export LC_ALL=C<br />
echo “export LC_ALL=C” &gt;&gt; ~/.bash_profile<br />
./Configure -de -Dprefix=/usr<br />
make<br />
make test<br />
sudo make install<br />
</code></p>
<p>Now I have my good old Perl back again.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.netcubed.de/2009/01/how-to-restore-perl-on-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
