Getting started with Catalyst Framework (install)

I’ve been a fan of Ruby on Rails for a while. I’ve not been able to find a hosting solution that keeps on the bleeding edge of Rails development. Most hosts are 2 or 3 years behind, which makes it very difficult to keep your site updated with the latest gems.

I found myself asking, “Why is that?” The answer is pretty simple: Rails has strict conventions. Those conventions tie you into developing on the framework. I have a similar issue currently at work where I’ve worked with PHP in the past, so it was assumed I would quickly and easily pick up on Drupal. For those of you who don’t know, drupal is a fairly large content management system with hooks and interfaces to the core which make it very easy to create modules. And, yet, you’re locked into that convention and tied into whatever modules you devour.

In the case of Ruby, it’s not really ‘difficult’ to make modifications, but doing so can quickly break the mantra of the framework. It’s not really fragile.. stubborn maybe? In Drupal’s case, in order to modify something being done at the core, you have to right a module which uses hooks or other callbacks. If you need to modify a module, you have to write another module. The code you write for Drupal can’t easily be extracted and used elsewhere (unlike Ruby’s gems).

The other day, I came across the Catalyst Framework. I’ve been reading about perl, and hoping to familiarize myself with it. There’s no better time than now.

Here are the steps I’ve taken for getting started with Catalyst Framework, a perl MVC framework.

  1. Install ‘cpan’: sudo apt-get install cpan
  2. Install ‘perl-doc’:

    ```bash $ sudo apt-get install perl-do

  3. Start &#8216;cpan&#8217;: </p> ```bash
$ cpan
  1. Set policy to follow:

    ```bash cpan[1]> o conf prerequisites_policy follow cpan[2]> o conf commit

  5. install cpanm: </p> ```bash
$ curl -L http://cpanmin.us | perl - --sudo App::cpanminus
  1. Install ‘YAML’:

    ```bash $ cpanm –sudo YAML

  7. Install &#8216;Catalyst::Manual&#8217;: </p> ```bash
$ cpanm --sudo Catalyst::Manual 
  1. To view the manual, run:

    ```bash $ perldoc Catalyst::Manual
    
    or.. install Pod::Browser and run it. There is a nice JavaScript-enabled user interface.
    
    ```bash
$ cpanm --sudo Pod::Browser
    $ pod_browser_server.pl
 
  1. Install ‘Catalyst::Runtime’ and ‘Catalyst::Devel’ via cpanm:

    ```bash $ cpanm –sudo Catalyst::Runtime $ cpanm –sudo Catalyst::Devel

 10. Scaffold your application: </p> ```bash
$ catalyst.pl MyApp
    $ cd MyApp
    $ script/myapp_create.pl controller Library::Login
 
That last line generates a login controller&#8230; </li> 

  * run this test application: </p> ```bash

$ script/myapp_server.pl

    
      * navigate to <a href="http://localhost:3000" target="_blank">http://localhost:3000</a> </ol> 
    
    ## Next Steps
    
      * Install a Perl IDE. I&#8217;ve chosen EPIC (an eclipse plugin) to start off with.
	    
        a. Open Eclipse and go to Install New Software
	    
        b. Add the site: &#8216;http://e-p-i-c.sf.net/updates/testing&#8217;
	    
        c. Choose the main application and install it. 
      * Read through documentation in Catalyst::Manual