<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>transfixed but not dead! &#187; Template Toolkit</title>
	<atom:link href="http://transfixedbutnotdead.com/tag/template-toolkit/feed/" rel="self" type="application/rss+xml" />
	<link>http://transfixedbutnotdead.com</link>
	<description>my ramblings on life, work &#38; anything left in-between</description>
	<lastBuildDate>Tue, 08 May 2012 09:57:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='transfixedbutnotdead.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/0a317653027efb1ab2bf8adde3dcb067?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>transfixed but not dead! &#187; Template Toolkit</title>
		<link>http://transfixedbutnotdead.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://transfixedbutnotdead.com/osd.xml" title="transfixed but not dead!" />
	<atom:link rel='hub' href='http://transfixedbutnotdead.com/?pushpress=hub'/>
		<item>
		<title>Pre-Render Template at Squatting start-up</title>
		<link>http://transfixedbutnotdead.com/2008/12/23/pre-render-template-at-squatting-start-up/</link>
		<comments>http://transfixedbutnotdead.com/2008/12/23/pre-render-template-at-squatting-start-up/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 20:50:21 +0000</pubDate>
		<dc:creator>draegtun</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[Squatting]]></category>
		<category><![CDATA[Template Toolkit]]></category>

		<guid isPermaLink="false">http://draegtun.wordpress.com/?p=120</guid>
		<description><![CDATA[In previous post I mentioned that you could build a static CSS file from a template when Squatting first starts up. Well here&#8217;s a complete example using Template Toolkit ( CSS.pm )&#8230;. $CSS::CONFIG{ pre_render } contains all the profiles to pre-render on. You just need to name a profile and tell it what template (tt), [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&#038;blog=351142&#038;post=120&#038;subd=draegtun&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://draegtun.wordpress.com/2008/12/23/css-views-in-squatting/">previous post</a> I mentioned that you could build a static CSS file from a template when Squatting first starts up. </p>
<p>Well here&#8217;s a complete example using Template Toolkit ( CSS.pm )&#8230;.</p>
<p><pre class="brush: perl;">
use strict;
use warnings;

{
    package CSS;
    use base 'Squatting';
    use Template;
    
    
    BEGIN {
        our %CONFIG = (
            
            docroot  =&gt; './www',    # Continuity htdocs
            static   =&gt; '/static',  # Our unique prefix/folder under above
            
            pre_render =&gt; {
                
                # CSS profile
                css =&gt; {
                    tt   =&gt; 'css.tt',       # CSS template 
                    file =&gt; 'static.css',   # Name of static file to build
                    v    =&gt; {               # template variables
                        colour =&gt; 'red',
                    },
                },
                
                # Other pre render template profile...
                # js     =&gt; { ... },
                # jquery =&gt; { ... },
                
            },

            TT =&gt; {
                object   =&gt; Template-&gt;new( INCLUDE_PATH =&gt; './tt' ),
                postfix  =&gt; '.tt',
                site_tit =&gt; 'Static CSS demo',
            },
        );
    }
    
    # static file handling
    sub continue {
        my $app = shift;
        $app-&gt;next::method(
            docroot =&gt; $CSS::CONFIG{ docroot },
            staticp =&gt; sub { 
                $_[0]-&gt;url =~ m/\.(jpg|jpeg|gif|png|css|ico|js|swf)$/ 
            },
            @_
        );
    }
    
    # pre-render stuff
    # for eg. lets build the CSS file on startup as ./www/static/static.css
    my $tt = $CSS::CONFIG{ TT }-&gt;{ object };
    my $prefix = $CSS::CONFIG{ docroot } . $CSS::CONFIG{ static } . '/';
    for my $key ( keys %{  $CSS::CONFIG{ pre_render } } ) {
        
        my $render = $CSS::CONFIG{ pre_render }-&gt;{ $key };
        
        open my $fh, '&gt;',  $prefix . $render-&gt;{ file }
            or die &quot;Unable to write to $render-&gt;{file}: $!&quot;;

        $tt-&gt;process( $render-&gt;{ tt }, $render-&gt;{ v }, $fh )
            or die &quot;Help!\n&quot;;

        close $fh;   
    }

}


{ 
    package CSS::Controllers;
    use Squatting ':controllers';
    
    our @C = (
        C(
            Home =&gt; [ '/' ],
            get   =&gt; sub { 
                my ( $self ) = @_;
                $self-&gt;render( 'home' );
            },
        ),
    );
}


{
    package CSS::Views;
    use Squatting ':views';

    our @V = (

        V(
            'tt',
            tt =&gt; $CSS::CONFIG{ TT }-&gt;{ object },

            layout =&gt; sub {
                my ( $self, $v, $body ) = @_;
                my $tt = $self-&gt;{ tt };
                $v-&gt;{ site_tit } = $CSS::CONFIG{ TT }-&gt;{ site_tit };
                $v-&gt;{ body     } = $body;

                my $output;
                $tt-&gt;process( 'layout'. $CSS::CONFIG{ TT }-&gt;{ postfix }, 
                               $v, \$output)
                    or return view_error( $tt-&gt;error );
                return $output;
            },

            _ =&gt; sub {
                my ( $self, $v ) = @_;
                my $tt = $self-&gt;{ tt };
                $v-&gt;{ R } = \&amp;R;
                $v-&gt;{ Static } = $CSS::CONFIG{ static };

                my $output;
                $tt-&gt;process( $self-&gt;{template} . 
                              $CSS::CONFIG{ TT }-&gt;{ postfix }, 
                              $v, \$output) 
                    or return view_error( $tt-&gt;error );
                return $output;
            },
        ),
    );

    sub view_error {
        my ( $error ) = shift;
        warn $error;
        return &quot;&lt;pre&gt;&quot; . $error . &quot;&lt;/pre&gt;\n&quot;;   # should HTML encode
    }    
}

1;
</pre></p>
<p>$CSS::CONFIG{ pre_render } contains all the profiles to pre-render on.   You just need to name a profile and tell it what template (tt), what static filename should be (file) &amp; provide variables for the rendering (v)&#8230;.</p>
<p><pre class="brush: perl;">
        # CSS profile
        css =&gt; {
            tt   =&gt; 'css.tt',         # CSS template 
            file =&gt; 'static.css',    # Name of static file to build
            v    =&gt; {                 # template variables
                colour =&gt; 'red',
            },
        },
</pre></p>
<p>So above renders css.tt to ./www/static/static.css</p>
<p>Here is an example css.tt<br />
<pre class="brush: css;">
h1 { color: [% colour %]; }
</pre></p>
<p>And to make things complete here the other templates (all in ./tt folder)&#8230;.</p>
<p><pre class="brush: xml;">
# layout.tt
&lt;html&gt;
&lt;head&gt;
  &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;
  &lt;title&gt;[% site_tit %]&lt;/title&gt;
  &lt;link rel=&quot;stylesheet&quot; href=&quot;[% Static %]/static.css&quot; type=&quot;text/css&quot; /&gt;
&lt;/head&gt;

&lt;body&gt;
[% body %]
&lt;/body&gt;
&lt;/html&gt;

# home.tt
&lt;h1&gt;This should be red&lt;/h1&gt;
</pre></p>
<p>And if all works fine then you will see &#8220;This should be red&#8221; in red <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>/I3az/</p>
<p>NB. This example should only be used with single occurrence of your App running with Squatting::On::Continuity.   For multiple occurrences then ideally you need to take care when writing to static file (ie. only write when changed or need locking or have unique static files for each occurrence).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/draegtun.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/draegtun.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/draegtun.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/draegtun.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/draegtun.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/draegtun.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/draegtun.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/draegtun.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/draegtun.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/draegtun.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/draegtun.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/draegtun.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/draegtun.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/draegtun.wordpress.com/120/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&#038;blog=351142&#038;post=120&#038;subd=draegtun&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://transfixedbutnotdead.com/2008/12/23/pre-render-template-at-squatting-start-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/29cb106071d163d703484e63839d89cb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">draegtun</media:title>
		</media:content>
	</item>
		<item>
		<title>CSS views in Squatting</title>
		<link>http://transfixedbutnotdead.com/2008/12/23/css-views-in-squatting/</link>
		<comments>http://transfixedbutnotdead.com/2008/12/23/css-views-in-squatting/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 16:43:04 +0000</pubDate>
		<dc:creator>draegtun</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[Squatting]]></category>
		<category><![CDATA[Template Toolkit]]></category>

		<guid isPermaLink="false">http://draegtun.wordpress.com/?p=105</guid>
		<description><![CDATA[From my earlier post today you will probably have noticed a problem with CSS files when something like following is used&#8230;. What we want this to be is otherwise it won&#8217;t find that image file in your static folder&#8230; This means we need to process a CSS template through a Squatting view (see Caveat). Here&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&#038;blog=351142&#038;post=105&#038;subd=draegtun&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>From my <a href="http://draegtun.wordpress.com/2008/12/23/using-squatting-with-reverse-proxy-apache/">earlier post</a> today you will probably have noticed a problem with CSS files when something like following is used&#8230;.</p>
<p><pre class="brush: css;">
body {
	background: url( /images/some_image.gif );
}
</pre></p>
<p>What we want this to be is otherwise it won&#8217;t find that image file in your static folder&#8230;</p>
<p><pre class="brush: css;">
body {
	background: url( [% Static %]/images/some_image.gif );
}
</pre></p>
<p>This means we need to process a CSS template through a Squatting view (see Caveat).</p>
<p>Here&#8217;s one way we can do this&#8230;..</p>
<p><pre class="brush: perl;">

# Controller code.....
    C( 
        CSS =&gt; [ '/css' ],
        get =&gt; sub { 
            my $self = shift; 
            $self-&gt;headers-&gt;{'Content-Type'} = 'text/css'; 
            $self-&gt;render( '_app_css' );
        },
    ),
</pre></p>
<p>&#8220;_app_css.tt&#8221; is now your CSS template.  The prefixed &#8220;_&#8221; in the $self-&gt;render stops it processing the layout view around it.  The layout.tt should now have this line&#8230;</p>
<p><pre class="brush: xml;">
    &lt;link rel=&quot;stylesheet&quot; href=&quot;[% R('CSS') %]&quot; type=&quot;text/css&quot; media=&quot;screen&quot; title=&quot;Demo&quot; /&gt;
</pre></p>
<p>So when rendered to browser the HTML will look like this&#8230;..</p>
<p><pre class="brush: xml;">
    &lt;link rel=&quot;stylesheet&quot; href=&quot;/css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; title=&quot;Demo&quot; /&gt;
</pre></p>
<p>So &#8220;/css&#8221; will call the CSS controller and render the template &#8220;_app_css.tt&#8221;.</p>
<p>And so Bob&#8217;s your Aunty <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>/I3az/</p>
<p><em>Caveat</em>: And its a big caveat&#8230;.  while its nice and could be very useful in lots of cases to serve up dynamic CSS, it is generally going to be a lot better to keep it as a static file and let Apache serve it up and gain all the cache benefits associated with this.</p>
<p>Two possible workarounds are&#8230;.</p>
<ul>
<li>Build static file from TT file.  This could even be done when Squatting app is first started.  Alternatively look at TT tpage &amp; ttree to do this process manually
<li>Put caching routines into your CSS View (eg. pre-build rendering, return 304 HTTP code).
</ul>
<p><em>NB.</em>: Replace CSS with Javascript in everything above.   Everything equally applies.</p>
<p>References</p>
<ul>
<li><a href="http://draegtun.wordpress.com/2008/10/21/using-template-toolkit-with-squatting/">Using Template Toolkit With Squatting</a>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/draegtun.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/draegtun.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/draegtun.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/draegtun.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/draegtun.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/draegtun.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/draegtun.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/draegtun.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/draegtun.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/draegtun.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/draegtun.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/draegtun.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/draegtun.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/draegtun.wordpress.com/105/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&#038;blog=351142&#038;post=105&#038;subd=draegtun&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://transfixedbutnotdead.com/2008/12/23/css-views-in-squatting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/29cb106071d163d703484e63839d89cb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">draegtun</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Template Toolkit with Squatting</title>
		<link>http://transfixedbutnotdead.com/2008/10/21/using-template-toolkit-with-squatting/</link>
		<comments>http://transfixedbutnotdead.com/2008/10/21/using-template-toolkit-with-squatting/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 12:04:53 +0000</pubDate>
		<dc:creator>draegtun</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Camping]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Squatting]]></category>
		<category><![CDATA[Template Toolkit]]></category>

		<guid isPermaLink="false">http://draegtun.wordpress.com/?p=45</guid>
		<description><![CDATA[Been playing with Squatting recently. Its a Perl Web microframework inspired by Camping. For someone like me who is still converting some old CGI apps to Catalyst then this looks like an interesting alternative. I use Template Toolkit quite a bit so here&#8217;s a boilerplate for using TT with Squatting&#8230;.. And here are the templates&#8230;. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&#038;blog=351142&#038;post=45&#038;subd=draegtun&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Been playing with <a href="http://search.cpan.org/dist/Squatting/">Squatting</a> recently.   Its a Perl Web microframework inspired by <a href="http://code.whytheluckystiff.net/camping">Camping</a>.  For someone like me who is still converting some old CGI apps to Catalyst then this looks like an interesting alternative.</p>
<p>I use Template Toolkit quite a bit so here&#8217;s a boilerplate for using TT with Squatting&#8230;..</p>
<p><pre class="brush: perl;">
use strict;
use warnings;

{
    package App;
    use base 'Squatting';

    BEGIN {
        our %CONFIG = (
            TT =&gt; {
                config   =&gt; { INCLUDE_PATH =&gt; '.' },
                postfix  =&gt; '.tt',
                site_tit =&gt; 'TT loves Squatting!',
            }
        );

    }
}

{
    package App::Controllers;
    use Squatting ':controllers';

    our @C = (

        C(
            Home =&gt; [ '/' ],
            get  =&gt; sub {
                my ( $self )  = @_;
                my $v         = $self-&gt;v;
                $v-&gt;{ tit }   = 'welcome to my homepage';
                $self-&gt;render( 'home' );
            },
        ),
        
        C(
            Page =&gt; [ '/path/to/page' ],
            get  =&gt; sub {
                my ( $self ) = @_;
                my $v        = $self-&gt;v;
                $v-&gt;{ tit  } = 'here is another page!';
                $v-&gt;{ list } = [ 'one', 'two', 'three' ];
                $self-&gt;render( 'page' );
            },
        ),

    );
}

{
    package App::Views;
    use Squatting ':views';
    use Template;

    our @V = (

        V(
            'html',
            tt =&gt; Template-&gt;new( $App::CONFIG{ TT }-&gt;{ config } ),

            layout =&gt; sub {
                my ( $self, $v, $body ) = @_;
                my $tt = $self-&gt;{ tt };
                $v-&gt;{ site_tit } = $App::CONFIG{ TT }-&gt;{ site_tit };
                $v-&gt;{ body     } = $body;
                
                my $output;
                $tt-&gt;process( 'layout'. $App::CONFIG{ TT }-&gt;{ postfix }, $v, \$output)
                    or return view_error( $tt-&gt;error );
                return $output;
            },

            _ =&gt; sub {
                my ( $self, $v ) = @_;
                my $tt = $self-&gt;{ tt };
                $v-&gt;{ R } = \&amp;R;
                
                my $output;
                $tt-&gt;process( $self-&gt;{template} . $App::CONFIG{ TT }-&gt;{ postfix }, $v, \$output) 
                    or return view_error( $tt-&gt;error );
                return $output;
            }

        ),
    );
    
    sub view_error {
        my ( $error ) = shift;
        warn $error;
        return &quot;&lt;pre&gt;&quot; . $error . &quot;&lt;/pre&gt;\n&quot;;   # really need to HTML encode $error here
    }
}

1;
</pre></p>
<p>And here are the templates&#8230;.</p>
<p>layout.tt<br />
<pre class="brush: xml;">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot;
   &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;

&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;
	&lt;title&gt;[% site_tit %]&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
[% body %]
&lt;/body&gt;
&lt;/html&gt;
</pre></p>
<p>home.tt<br />
<pre class="brush: xml;">
&lt;h1&gt;Hello.. [% tit %]&lt;/h1&gt;

&lt;a href=&quot;[% R('Page') %]&quot;&gt;Have a look here&lt;/a&gt;
</pre></p>
<p>page.tt<br />
<pre class="brush: xml;">
&lt;h1&gt;Hello again... [% tit %]&lt;/h1&gt;

&lt;p&gt;$v-&gt;{list}...&lt;/p&gt;

&lt;ul&gt;
    [% FOREACH item IN list %]
    &lt;li&gt;[% item %]&lt;/li&gt;
    [% END %]
&lt;/ul&gt;

&lt;a href=&quot;[% R('Home') %]&quot;&gt;back to home&lt;/a&gt;
</pre></p>
<p>Stash variables in Squatting (ie. variables that can used between controller &amp; the view/template) can be set/get by $self-&gt;v<br />
<em>NB. &#8220;v&#8221; is for variables and shouldn&#8217;t be confused in anyway with &#8220;view&#8221; ;-(</em></p>
<p>Using &#8220;layout[.tt]&#8221; method/template is optional in Squatting (and Camping) so u can drop this and it will just render the view/template only.  The code uses &#8220;layout&#8221; thus home.tt &amp; page.tt renders as [% body %] via layout.tt</p>
<p>R() returns the route used by the specified controller ( for eg. R(&#8216;Page&#8217;) returns &#8220;/path/to/page&#8221; ).  This is quite a handy subroutine to export to TT templates!</p>
<p>So see it working just name above program &#8220;App.pm&#8221; and put in same directory as the template files and just do <code>squatting App</code> and then point your browser to http://localhost:4234/</p>
<p>Hopefully more on Squatting soon.  So if u fancy a bit of fun web programming then give Squatting a go!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/draegtun.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/draegtun.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/draegtun.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/draegtun.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/draegtun.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/draegtun.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/draegtun.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/draegtun.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/draegtun.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/draegtun.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/draegtun.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/draegtun.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/draegtun.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/draegtun.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&#038;blog=351142&#038;post=45&#038;subd=draegtun&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://transfixedbutnotdead.com/2008/10/21/using-template-toolkit-with-squatting/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/29cb106071d163d703484e63839d89cb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">draegtun</media:title>
		</media:content>
	</item>
	</channel>
</rss>
