Sunday, December 22, 2013

Install Catalyst

1. Initialize cpan

cpan> o conf init

2. Install CPAN::SQLite and LWP

cpan[4]> install CPAN::SQLite LWP YAML Test::Output Test::LeakTrace Algorithm::C3 SUPER Module::Refresh Data::Visitor Test::Builder Specio IO::String

3. Switch use_sqlite if it was not

cpan> o conf use_sqlite 0
cpan> o conf commit
cpan> reload index
cpan> install CPAN::SQLite
cpan> o conf use_sqlite 1
cpan> o conf commit

4. Install Catalyst::Runtime Catalyst::Devel

cpan[4]> install Catalyst::Runtime Catalyst::Devel

5. Check Installation


[catalyst@catalyst ~]$ perlbrew list
  perl-5.6.2
  perl-5.8.9
  perl-5.10.1
  perl-5.12.5
  perl-5.14.4
  perl-5.16.3
  perl-5.18.1
  perl-5.19.7
[catalyst@catalyst ~]$ perlbrew use perl-5.8.9

A sub-shell is launched with perl-5.8.9 as the activated perl. Run 'exit' to finish it.

bash-4.1$ source perlbrew.sh
[perl-5.8.9] catalyst@catalyst ~$ [ 164 ]>> : perl -MCatalyst::Runtime -e 'print Catalyst::Runtime->VERSION'
5.90052[perl-5.8.9] catalyst@catalyst ~$ [ 165 ]>> :


Saturday, December 21, 2013

Install Perlbrew

1. Install the Perlbrew

Install development tools.
yum groupinstall "Development Tools"
yum install wget lynx ncftpget ncftp ftp gpg patch applypatch


Copy & Paste this line into your terminal:
\curl -L http://install.perlbrew.pl | bash
 
Or, if your system does not have curl but something else:
# Linux
\wget -O - http://install.perlbrew.pl | bash

# FreeBSD
\fetch -o- http://install.perlbrew.pl | sh
 
If you prefer to install with cpan, there are two steps:
sudo cpan App::perlbrew
perlbrew init 
If it is installed with cpan, the perlbrew executable should be installed as /usr/bin/perlbrew or /usr/local/bin/perlbrew. For all users who want to use perlbrew, a prior perlbrew init needs to be executed.

The default perlbrew root directory is ~/perl5/perlbrew, which can be changed by setting PERLBREW_ROOT environment variables before the installation and initialization. For more advanced installation process, please read the perlbrew document.

export PERLBREW_ROOT=$HOME/perl5/perlbrew
export PERLBREW_HOME=$PERLBREW_ROOT
export PATH=$PATH:$PERLBREW_HOME/bin


2. Check available Perl distribution.

[catalyst@catalyst ~]$ perlbrew available
  perl-5.19.7
  perl-5.18.1
  perl-5.16.3
  perl-5.14.4
  perl-5.12.5
  perl-5.10.1
  perl-5.8.9
  perl-5.6.2
  perl5.005_04
  perl5.004_05
  perl5.003_07



3. Install Perl distribution


perlbrew install-multiple  perl-5.6.2 perl-5.8.9 perl-5.10.1 perl-5.12.5 perl-5.14.4 perl-5.16.3 perl-5.18.1 perl-5.19.7




4. Configure the shell variables : perlbrew.sh


update_for_perlbrew() {
   local name="$( perlbrew list | perl -lane'print $F[1] if /^\*/' )"

   if [ -z "$name" ]; then
      name="$( perl -e'$v = $^V || $]; $v =~ s/^v//; print $v' )"
   fi

   # Adjust window title here

   echo "[$name]"
}


PS1='$( update_for_perlbrew ) \u@\h \W$ [ \! ]>> : '

alias ll="ls -l"
alias lla="ls -al"