Quantcast
Viewing all articles
Browse latest Browse all 2

Answer by Jim for Install perl to /usr/local/bin

You can build Perl from source, then placing them to /usr/local/bin.

  1. Download perl tarball file from their website, unpack it.

    wget https://www.cpan.org/src/5.0/perl-5.22.0.tar.gz
    tar -xvzf perl-5.22.0.tar.gz
    cd perl-5.22.0/
    
  2. Proceed to installation through make.

    ./Configure -des -Dprefix=/usr/local
    make
    make test
    sudo make install
    

This will install Perl version 5.22.0 to directory /usr/local/bin, which you can call the executable as /usr/local/bin/perl.

:~$ /usr/local/bin/perl --version

This is perl 5, version 22, subversion 0 (v5.22.0) built for x86_64-linux

Copyright 1987-2015, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

Although the most logical way would be replacing the shebang line to exactly /usr/bin/perl, you can do so by.

find /path/to/script -name '*.pl' | xargs perl -pi -e 's{^#!/usr/local/bin/perl}{#!/usr/bin/perl}'

Will change #!/usr/local/bin/perl#!/usr/bin/perl.


Viewing all articles
Browse latest Browse all 2

Trending Articles