0

I am not experienced in Perl and working on Ubuntu.

I was working on Ubuntu 10.10. I installed the latest Catalyst version from the cat-install script and SQLite by sudo apt-get install sqlite. After installing Catalyst I was able to run my server using Catalyst script but after installing SQLite when I try to run the server I get a compilation error in perl5/namespace/autoclean.pm saying &namespace undefined subroutine. But I never touched any code in there.

I am not looking to debug my problem as already my Ubuntu crashed last night. :( I just need to know the best practices for installing these packages and will be very thankful if one can specifically guide me how to install these packages.

daxim
  • 39,270
  • 4
  • 65
  • 132
peloooo
  • 1
  • 1

2 Answers2

1

This is what I did at work the other day:

1.  Obtain perl, e.g. current stable (as of the 12th of Jan 2011):

 $ curl http://cpan.perl.org/src/5.0/perl-5.12.2.tar.gz -O
 $ gunzip -c perl-5.12.2.tar.gz | tar xvf -
 $ cd perl 5.12.2
 $ sh Configure -des -Dprefix=~/perl-5.12 # install into ~/perl-5.12
 $ make
 $ make test
 $ make install

2.  Configure PATH and cpan config, by putting the following in ~/.bashrc:

 export PERL_MM_USE_DEFAULT=1
 export PATH=~/perl-5.12/bin:$PATH
 export MANPATH=~/perl-5.12/man:$MANPATH # breaks stuff on solaris

Make CPAN slightly nicer to deal with.

 $ source ~/.bashrc
 $ cpan Bundle::CPAN
 $ cpan App::cpanminus

=head2 Deploying to a different machine using the same architecture

Just copy ~/perl-5.12 over to the new machine and put perl-5.12/bin in the $PATH.

Then install catalyst:

$ cpanm Catalyst::Devel
$ cpanm Catalyst::Runtime
$ cpanm DBIx::Class # gives you sqlite along with it
singingfish
  • 3,136
  • 22
  • 25
  • thanks for the answer.I will try later in the day when I start repairing my OS. On running cpanm Catalyst::Devel and Runtime too it asks a series of notorious questions which I have no idea what to answer. – peloooo Jan 17 '11 at 11:08
  • perlbrew lets you install custom local Perl(s). This could simplify thins for you quite a bit. If coupled with cpanm and locallib very powerful. – J.J. Jan 17 '11 at 16:01
  • Avoid such scenario while you can. Stick to official repos and get everything running. If you then need for some reasons something from CPAN/source you have much better experience for experimenting with possible conflicts. Just my 2 ¢. – w.k Feb 11 '11 at 20:55
  • I strongly disagree with wk. You *are* going to need CPAN. If there's a vendor perl update it may break your own development environment so it's best just to bypass the vendor perl entirely. Avoiding CPAN until you can't avoid it is silly and missing the best thing about Perl. – singingfish Feb 11 '11 at 22:38
1

The Catalyst runtime is also packaged on Ubuntu. You can install it the same way you did with SQLite. The package name is libcatalyst-perl.

daxim
  • 39,270
  • 4
  • 65
  • 132
  • My problem is that even after installing the same way I am getting compilation errors in perl5. I also installed using libcatalyst-perl. No luck :( – peloooo Jan 17 '11 at 11:13
  • You should clean up the installed files from `cat-install` so they do not conflict any more. Ask a new question if you need details. – daxim Jan 17 '11 at 11:15
  • how to clean up everything (sounds duh) – peloooo Jan 17 '11 at 11:16