--- /dev/null
+#!/usr/bin/perl\r
+# Root.pm \r
+# Copyright (c) 2006 Jonathan Rockway <jrockway@cpan.org>\r
+\r
+package TestApp::Controller::Root;\r
+use base qw(Catalyst::Controller);\r
+__PACKAGE__->config->{namespace} = q{};\r
+my @words = qw(foo bar baz bat qux quux);\r
+\r
+sub index : Private {\r
+ my ($self, $c, @args) = @_;\r
+ my $words = $c->uri_for('/words');\r
+ $c->response->body(<<"HERE");\r
+<html>\r
+<head>\r
+<title>TestApp</title>\r
+</head>\r
+<body>\r
+<h1>TestApp</h1>\r
+<p>This is the TestApp.</p>\r
+<p><a href="$words">Click here</a> to <i>see</i> some words.</p>\r
+</body>\r
+</html> \r
+HERE\r
+}\r
+\r
+sub words : Local {\r
+ my ($self, $c, $times) = @_;\r
+ $times ||= 0;\r
+ my $html = <<"HEADER";\r
+<html>\r
+<head>\r
+<title>TestApp</title>\r
+</head>\r
+<body>\r
+<h1>TestApp << Words</h1>\r
+<p>Here you'll find all things "words" printed $times time(s)!</p>\r
+<ul>\r
+HEADER\r
+ local $" = q{ }; # single space\r
+ $html .= " <li>$_: @words</li>\n" for 1..$times;\r
+ $html .= <<"FOOTER"; \r
+</ul>\r
+</body>\r
+</html>\r
+FOOTER\r
+ $c->response->body($html);\r
+}\r
+\r
+sub null : Path('/favicon.ico'){\r
+ my ($self, $c) = @_;\r
+ $c->response->status(404); # doesn't exist\r
+}\r
+\r
+1; # true.\r
+\r