Installing Catalyst

Now that you're convinced that you want to try Catalyst, you just have to install it. As Catalyst is Perl-based, you'll need to have a working version of Perl. Most Linux and BSD distributions come with a suitable Perl in the default install, as do many commercial Unix variants (Mac OS X is no exception). Microsoft Windows doesn't ship with Perl, but you can get a Perl distribution for free from ActiveState, Strawberry Perl, or Cygwin. Regardless of your operating system, you'll need Perl version 5.8.1 or higher (5.8.8, which is the latest at the time of writing, is the version used in this book).

Note

Version 5.10.x is already out, but as 5.8 is more widely used, the examples should stay that way. Ubuntu, for example, already ships 5.10 for a while.

The easiest way to install Catalyst is via your operating system's package manager. This mostly applies to Linux and the BSDs and the syntax is specific to your distribution. On Debian-based versions of GNU/Linux, the command is:

$ apt-get install libcatalyst-perl

On FreeBSD or OpenBSD, you can build the Catalyst port by running the following commands as root:

$ cd /usr/ports/www/p5-Catalyst-Runtime
$ make install

If you're using ActiveState on Windows, ActiveState has a PPM (Perl Package Manager) package for Catalyst. You can find the PPM at http://cpan.uwinnipeg.ca/dist/ Catalyst-Runtime.

Finally, be sure to check your operating system's manual for specific instructions on installing packages. The latest details are available from the Catalyst installation guide at http://search.cpan.org/perldoc?Catalyst::Manual::Installation.

CPAN

If your operating system doesn't provide packages, installing Catalyst directly from the CPAN is a simple process. Perl ships with a utility called cpan that handles the installation process for you. Simply run the following from the command line:

$ cpan Catalyst::Runtime Catalyst::Devel

and Catalyst (and all of its dependencies) will be downloaded, integrity-checked, and installed.

The disadvantage of this approach is that you'll need a C compiler gcc, make, and related development utilities. Most Linux distributions have these available, but they aren't a part of the default install. Mac OS X offers gcc and make as part of its developer tools package, which you'll need to install if you choose to use cpan.

Unfortunately, the cpan script is notorious for asking difficult questions the first time that you run it (in order to build a configuration suitable for your system). If you want to avoid these questions and just get Catalyst installed, try the cat-install script at http://www.shadowcat.co.uk/static/cat-install. You can download that file, run it with Perl, and Catalyst should be installed when it's finished running.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.168.211