In this final example, we'll build an entire model from scratch without even the help of a model base class like Catalyst::Model::DBI
. Before you do this for your own application, you should check the CPAN to see if anyone's done anything similar already. There are currently about fifty ready-to-use model base classes that abstract data sources, such as LDAP servers, RSS readers, shopping carts, search engines, subversion, e-mail folders, web services, and even YouTube. Expanding upon one of these classes will usually be easier than writing everything yourself.
For this example, we'll create a very simple blog application. To post the blog, you just write some text and put it in a file whose name is the title you want on the post. We'll write a Filesystem model from scratch to provide the application with the blog posts.
Let's start by creating the application's skeleton:
$ catalyst.pl Blog
After that, we'll create our Filesystem model:
$ cd Blog $ perl script...