<?xml version="1.0" encoding="windows-1252"?>
<node id="570777" title="Install Perl Locally -- If this works for Catalyst, it'll work for anything!" created="2006-09-01 10:27:40" updated="2006-09-01 06:27:40">
<type id="120">
perlmeditation</type>
<author id="396583">
tphyahoo</author>
<data>
<field name="doctext">
First, some background.
&lt;p&gt;
I had a lot of trouble installing a Catalyst/DBIC development environment. I have left various 

&lt;a href="http://perlmonks.org/?node_id=564720"&gt;crumbs&lt;/a&gt; of 

&lt;a href="http://dev.catalyst.perl.org/wiki/Dreamhost"&gt;angst&lt;/a&gt; 

(* check the wiki history :) )

around the monastery and the catalyst wiki, begging for help on how to do this and not really getting a satisfactory answer.
&lt;p&gt;
To be fair, the base catalyst install alone was clean -- I think there's been a lot of work getting this into a state where it can be easily installed from CPAN recently. But cpen -i Catalyst won't get you far. To get the most leverage, you need DBIC, and various DBIC helpers, and various Catalyst helpers. These tend to be on the bleeding edge of CPAN, and to have dependencies that are even more bleeding edge than they are.
&lt;p&gt;
These won't install without the occasional force, as root.
&lt;p&gt;
And as non-root, I had constant cronic problems involving warnings telling me this was not doable without sudo, that directory wasn't writable... and this even after hours of experimentation with variations on the suggestions in nodes such as 
&lt;p&gt;
[id://12444], 
&lt;p&gt;
and catalyst propaganda such as 
&lt;p&gt;
&lt;a href="http://www.catalystframework.org/calendar/2005/10"&gt;Catalyst on Shared Hosting (advent calendar)&lt;/a&gt;
&lt;p&gt;
The usual advice is to configure some combination of PERL5LIB/PREFIX/LIBS/UNINST/choose your poison, and when the magic env vars are set, everything will "just work". This is probably true for simple installs that don't have a lot of dependencies. But it's not true at the bleeding edge of CPAN. At the bleeding edge of CPAN, install don't "just work" as advertised. 
&lt;p&gt;
Why not? I haven't really tracked down the root cause, but for a small whiff of  what I suspect is a very big pile of stink, have a look at [id://564720] and then the &lt;a href="http://groups.google.com/group/comp.lang.perl.modules/browse_thread/thread/1ad581ad5b6e65cd/af9e7d1bc4e1bcee?lnk=st&amp;q=&amp;rnum=1&amp;hl=en#af9e7d1bc4e1bcee"&gt;c.p.l.m thread&lt;/a&gt; mentioned by [tinita]. Over my head but in any case... uh oh.
&lt;p&gt;
Passing on, when I finally got all my goodies installed (as root), I had this nagging worry that I wouldn't be able to reliably recreate the my development environment without a lot of manual trial and error. Of course I could just tar up my perl install, but that didn't feel clean.
&lt;p&gt;
With all this drama, I was slowly started to get the feeling I  would have to become a CPAN ninja to feel safe using catalyst, and that this was not a good thing.
&lt;p&gt;
Well, in this case, it seems that light at the end of tunnel was not a train. Or, if it was a train, it still hasn't run me over :)
&lt;p&gt;
The solution -- the right solution, the one that feels clean to me -- was to install a local version of perl, configure my environment to use that in an intuitive way, and then maintain a perl script for the cpan install, that installs everything in the right order. The install script is under active development, constantly being tweaked, and the tweaks are being tracked in version control. 
&lt;p&gt;
This feels right.
&lt;p&gt;
Works for root, works for non root. And as root, the nice thing is that if my perl gets borked for some reason, or I just need to start over, it's easy. Delete perl, recompile perl locally, and run the install script.
&lt;p&gt;
&lt;readmore&gt;
Finally, here is my recipe for installing perl locally on a freshly installed Debian. FWIW, this was for Debian 3.01 on my virgin &lt;a href="http://tektonic.net"&gt;tektonic VPS&lt;/a&gt;. 
&lt;p&gt;
&lt;CODE&gt;
as root:

(
apt-get -y update
apt-get -y upgrade
apt-get -y install libc6-dev
apt-get -y install gcc
apt-get -y install emacs21
apt-get -y install subversion
apt-get -y install postgresql
)
&lt;p&gt;
then, adduser thartman
&lt;p&gt;
then, as thartman:
&lt;p&gt;
(
wget http://search.cpan.org/CPAN/authors/id/N/NW/NWCLARK/perl-5.8.8.tar.gz
tar -xzvf perl-5.8.8.tar.gz
cd perl-5.8.8
sh Configure -Dprefix=/home/thartman/perlroot/perl -des #make this your home directory
make test
make install
mkdir -p ~/usr/local #used for template toolkit installation
) | tee perlinstall.out

( cat &gt;&gt; ~/.bashrc
export $PATH=~/home/thartman/perlroot/perl/bin:$PATH
export FTP_PASSIVE=1 )

cpan,
  manual configuration? no
  o conf prerequisites_policy follow
  o conf commit
  install cpan
    (i.e., upgrade CPAN)
&lt;/CODE&gt;
&lt;p&gt;
Now, obviously the apt-get lines still require root, but I still think this is a huge improvement. And maybe there's some way to apt-get as a non-root, I don't know, I'm still learning my way around debian.
&lt;p&gt;
But at any rate, this is the constellation that has brought me peace of mind with catalyst and, I suspect, moving forward, peace of mind with a variety of non-plain-vanilla perl contexts.
&lt;p&gt;
Hope this helps! 
&lt;p&gt;
Note: I was partly inspired to write this when I came across &lt;a href="http://cpm.livejournal.com/344729.html"&gt;Catalyst: Compile your own perl in your home directory and don't worry about it&lt;/a&gt;. 
&lt;p&gt;
Also of interest might be my bookmarks at &lt;a href="http://del.icio.us/tphyahoo/perl-clean-install"&gt;perl clean install&lt;/a&gt;
&lt;/readmore&gt;
UPDATE: Matt trout has recently updated the &lt;a href="http://dev.catalyst.perl.org/wiki/Dreamhost"&gt;shared hosting with dreamhost&lt;/a&gt; bit of the catalyst wiki, and said that he done this enough times that he is convinced it works.
&lt;p&gt;
I haven't tried the updated instructions yet. 
&lt;p&gt;
UPDATE 2: Just in case it helps someone, here is my "constantly under development script, install-my-catalyst-mods.pl. This is nothing special; it just uses cpan through perl to get things installed in the correct order and minimize complaining about missing dependencies. 
&lt;p&gt;
My guiding principle is, given a virgin debian server (eg a VPS box I could buy without hassle and for pennies a day), configure perl + cata environment in under an hour. This is harder than it sounds, but doable.
&lt;p&gt;
&lt;code&gt;
#!/home/thartman/perlroot/perl/bin/perl
use strict;
use warnings;
use CPAN;

# Htmlwidget:
# test for Net::DNS::Resolver::Recurse fails on tektonic VPS
# same as reported in http://www.nntp.perl.org/group/perl.cpan.testers/341522
# but we go ahead and use this module anyway
force('install', 'Net::DNS');
install('HTML::Widget');

#goto Digestcolumns;
for my $mod qw(
  Catalyst::Plugin::ConfigLoader
  Catalyst::Plugin::Session::State::Cookie
  Catalyst::Plugin::Static::Simple
  Catalyst::Plugin::StackTrace
  Catalyst::Plugin::Authentication
  Catalyst::Plugin::Authentication::Store::DBIC
  Catalyst::Plugin::Authentication::Credential::Password
  Catalyst::Plugin::Authorization::Roles
  Catalyst::Plugin::Authorization::ACL
  Catalyst::Plugin::Session
  Catalyst::Plugin::Session::Store::FastMmap
  HTML::Widget
  Catalyst::Plugin::HTML::Widget
  Catalyst::View::TT
  Algorithm::C3
  Class::C3
  DBIx::Class
  Catalyst::Model::DBIC::Schema
  Lingua::EN::Inflect::Number
  Catalyst::Action::RenderView
  DBD::Pg
) {
    if ( my $result = install ($mod) ) {
      die "couldn't instal: $mod, result: $result";
    }
    #print "result: $result";
    #die;#die "couldn't install: $mod";
}

Digestcolumns:
#install ('XML::XPath');
install ('IO::Scalar');
install ('Text::RecordParser');
install ('SQL::Translator');
force ( 'install', 'DBIx::Class::DigestColumns');
die;

Cpanplus:
install ('Bundle::CPANPLUS::Dependencies');
install ('Module::Loaded');
install ('Package::Constants');
install ('Test::Harness');
install ('CPANPLUS');

# Module::Signature causes headache, see list posts.
system('rm -f /usr/lib/perl5/site_perl/5.8.8/Module/Signature.pm');
die;
&lt;/code&gt;</field>
</data>
</node>
