Coder Social home page Coder Social logo

app-perlbrew's Introduction

NAME

    App::perlbrew - Manage perl installations in your $HOME

SYNOPSIS

        # Installation
        curl -L https://install.perlbrew.pl | bash
    
        # Initialize
        perlbrew init
    
        # See what is available
        perlbrew available
    
        # Install some Perls
        perlbrew install 5.32.1
        perlbrew install perl-5.28.3
        perlbrew install perl-5.33.6
    
        # See what were installed
        perlbrew list
    
        # Swith to an installation and set it as default
        perlbrew switch perl-5.32.1
    
        # Temporarily use another version only in current shell.
        perlbrew use perl-5.28.3
        perl -v
    
        # Turn it off and go back to the system perl.
        perlbrew off
    
        # Turn it back on with 'switch', or 'use'
        perlbrew switch perl-5.32.1
        perlbrew use perl-5.32.1
    
        # Exec something with all perlbrew-ed perls
        perlbrew exec -- perl -E 'say $]'

DESCRIPTION

    perlbrew is a program to automate the building and installation of perl
    in an easy way. It provides multiple isolated perl environments, and a
    mechanism for you to switch between them.

    Everything are installed unter ~/perl5/perlbrew. You then need to
    include a bashrc/cshrc provided by perlbrew to tweak the PATH for you.
    You then can benefit from not having to run sudo commands to install
    cpan modules because those are installed inside your HOME too.

    For the documentation of perlbrew usage see perlbrew command on
    MetaCPAN <https://metacpan.org/>, or by running perlbrew help, or by
    visiting perlbrew's official website <https://perlbrew.pl/>. The
    following documentation features the API of App::perlbrew module, and
    may not be remotely close to what your want to read.

INSTALLATION

    It is the simplest to use the perlbrew installer, just paste this
    statement to your terminal:

        curl -L https://install.perlbrew.pl | bash

    Or this one, if you have fetch (default on FreeBSD):

        fetch -o- https://install.perlbrew.pl | sh

    After that, perlbrew installs itself to ~/perl5/perlbrew/bin, and you
    should follow the instruction on screen to modify your shell rc file to
    put it in your PATH.

    The installed perlbrew command is a standalone executable that can be
    run with system perl. The minimum required version of system perl is
    5.8.0, which should be good enough for most of the OSes these days.

    A fat-packed version of patchperl is also installed to
    ~/perl5/perlbrew/bin, which is required to build old perls.

    The directory ~/perl5/perlbrew will contain all install perl
    executables, libraries, documentations, lib, site_libs. In the
    documentation, that directory is referred as perlbrew root. If you need
    to set it to somewhere else because, say, your HOME has limited quota,
    you can do that by setting PERLBREW_ROOT environment variable before
    running the installer:

        export PERLBREW_ROOT=/opt/perl5
        curl -L https://install.perlbrew.pl | bash

    As a result, different users on the same machine can all share the same
    perlbrew root directory (although only original user that made the
    installation would have the permission to perform perl installations.)

    You may also install perlbrew from CPAN:

        cpan App::perlbrew

    In this case, the perlbrew command is installed as /usr/bin/perlbrew or
    /usr/local/bin/perlbrew or others, depending on the location of your
    system perl installation.

    Please make sure not to run this with one of the perls brewed with
    perlbrew. It's the best to turn perlbrew off before you run that, if
    you're upgrading.

        perlbrew off
        cpan App::perlbrew

    You should always use system cpan (like /usr/bin/cpan) to install
    App::perlbrew because it will be installed under a system PATH like
    /usr/bin, which is not affected by perlbrew switch or use command.

    The self-upgrade command will not upgrade the perlbrew installed by
    cpan command, but it is also easy to upgrade perlbrew by running cpan
    App::perlbrew again.

PROJECT DEVELOPMENT

    perlbrew project <https://perlbrew.pl/> uses github
    https://github.com/gugod/App-perlbrew/issues for issue tracking. Issues
    sent to these two systems will eventually be reviewed and handled. To
    participate, you need a github account.

    Please briefly read the short instructions about how to get your work
    released to CPAN:

    https://github.com/gugod/App-perlbrew/blob/develop/CONTRIBUTING.md

AUTHOR

    Kang-min Liu <[email protected]>

COPYRIGHT

    Copyright (c) 2023 Kang-min Liu <[email protected]>.

LICENCE

    The MIT License

DISCLAIMER OF WARRANTY

    BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
    FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT
    WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
    PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND,
    EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
    ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
    YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
    NECESSARY SERVICING, REPAIR, OR CORRECTION.

    IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
    WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
    REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE
    TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR
    CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
    SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
    RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
    FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
    SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
    DAMAGES.

app-perlbrew's People

Contributors

ap avatar arc avatar castaway avatar cavemanpi avatar chromatic avatar doherty avatar fluca1978 avatar friedo avatar gugod avatar hoelzro avatar jmaslak avatar juster avatar kmcgrath avatar melo avatar miyagawa avatar mstreuhofer avatar perigrin avatar polettix avatar rage311 avatar rwstauner avatar salva avatar tokuhirom avatar trcjr avatar tudorconstantin avatar vsespb avatar woody2143 avatar xdg avatar xsawyerx avatar yanick avatar yibe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

app-perlbrew's Issues

Auto-configure CPAN.pm

It would be awesome if Perlbrew could auto-configure CPAN.pm when it builds a new perl, including setting urllist, and have it put all its build jibber-jabber in a perl-build-specific directory such as .../perl-$VERSION/.cpan

perlbrew clone

A useful feature would be the ability to clone previously brewed perls, saving on the amount of time it takes to recompile and rebuild all of perl, and also ensuring that module versions are automatically consistent between installations. This would probably require some fairly clever hacks in terms of altering the compiled-in search path (binary patching?), but if it could be made to work, it would be pretty awesome.

perlbrew exec might not function quite right O_o

with perlbrew on (using 5.12.3):

$ perlbrew exec perl -e 'print "ok\n";' ; perl perlbrew exec perl -e 'print "ok\n";' ; perl -v
perl-5.10.1
==========


perl-5.12.0
==========


perl-5.12.2
==========


perl-5.12.3
==========


perl-5.14.0-RC1
==========


perl-5.8.9
==========


perl-blead
==========


perl-5.10.1
==========
ok


perl-5.12.0
==========
ok


perl-5.12.2
==========
ok


perl-5.12.3
==========
ok


perl-5.14.0-RC1
==========
ok


perl-5.8.9
==========
ok


perl-blead
==========
ok



This is perl 5, version 12, subversion 3 (v5.12.3) built for x86_64-linux

Copyright 1987-2010, 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.

with perlbrew off (using system perl, 5.10.1 with threading and patches):

$ perlbrew off
$ perlbrew exec perl -e 'print "ok\n";' ; perl perlbrew exec perl -e 'print "ok\n";' ; perl -v
perl-5.10.1
==========


perl-5.12.0
==========


perl-5.12.2
==========


perl-5.12.3
==========


perl-5.14.0-RC1
==========


perl-5.8.9
==========


perl-blead
==========


perl-5.10.1
==========
ok


perl-5.12.0
==========
ok


perl-5.12.2
==========
ok


perl-5.12.3
==========
ok


perl-5.14.0-RC1
==========
ok


perl-5.8.9
==========
ok


perl-blead
==========
ok



This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi
(with 40 registered patches, see perl -V for more detail)

Copyright 1987-2009, 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.

Deletes PERL5LIB right before patchperl fails to find Devel::PatchPerl

Saw the announcement about Ubuntu 11.04 and upgraded Perlbrew to 0.21 and Devel::PatchPerl to 0.36, but I still can't install perl-5.12.3 because patchperl fails to find Devel::PatchPerl in PERL5LIB, because Perlbrew.pm deletes it right before it calls patchperl (in do_install_this()).

My modules are in a local::lib and that's the only way I can install D::PatchPerl on some machines. Not sure how to work around this. I assume PB wants to avoid pollution from PERL5LIB, but how else am I supposed to find D::PatchPerl?

fatpacked patchperl has itself in shebang

the patchperl downloaded from
https://gist.github.com/raw/962406/eeffe0e4acf0cc6ff1fa7bc60586d3dc26e3f41a/patchperl

has a shebang line of

!/usr/bin/env patchperl

That looks odd to me, but i'll take your word for it if its supposed to be that way.

I looked at the fatpacked version of cpanm and it in fact uses the more normal looking

!/usr/bin/env perl

Just thought I'd let you know in case that was incorrect.

p.s. I tried to fork and edit the gist (https://gist.github.com/962861) but couldn't figure out how to do a pull request from there.

ccache support

Hi there,

I love perlbrew!

However, when compiling a bunch of perls I like to use ccache to speed things up. However, it looks like the -Dcc=ccache\ gcc is turned into -Dcc=ccache, which does not compile things properly:

lonesome@ubuntu-10:~$ perlbrew install -v perl-5.14.0 -Dcc=ccache\ gcc -Dld=gcc
Use the previously fetched perl-5.14.0.tar.gz
Installing /home/lonesome/perl5/perlbrew/build/perl-5.14.0 into ~/perl5/perlbrew/perls/perl-5.14.0
cd /home/lonesome/perl5/perlbrew/build/perl-5.14.0;rm -f config.sh Policy.sh;patchperl;sh Configure -de '-Dprefix=/home/lonesome/perl5/perlbrew/perls/perl-5.14.0' '-Dcc=ccache' '-Dld=gcc';make ;make test_harness && make install
sh: patchperl: not found

Beginning of configuration questions for perl5.

Checking echo to see how to suppress newlines...
...using \c
The star should be here-->*

First let's make sure your kit is complete.  Checking...
Looks good...


Would you like to see the instructions? [n]  

Locating common programs...
awk is in /usr/bin/awk.
cat is in /bin/cat.
chmod is in /bin/chmod.
comm is in /usr/bin/comm.
cp is in /bin/cp.
echo is in /bin/echo.
expr is in /usr/bin/expr.
grep is in /bin/grep.
ls is in /bin/ls.
mkdir is in /bin/mkdir.
rm is in /bin/rm.
sed is in /bin/sed.
sort is in /usr/bin/sort.
touch is in /usr/bin/touch.
tr is in /usr/bin/tr.
uniq is in /usr/bin/uniq.

Don't worry if any of the following aren't found...
ar is in /usr/bin/ar.
I don't see bison out there, offhand.
I don't see byacc out there, either.
cpp is in /usr/bin/cpp.
I don't see csh out there, either.
date is in /bin/date.
egrep is in /bin/egrep.
I don't see gmake out there, either.
gzip is in /bin/gzip.
less is in /usr/bin/less.
ln is in /bin/ln.
make is in /usr/bin/make.
more is in /bin/more.
nm is in /usr/bin/nm.
nroff is in /usr/bin/nroff.
perl is in /usr/bin/perl.
pg is in /usr/bin/pg.
test is in /usr/bin/test.
uname is in /bin/uname.
I don't see zip out there, either.
Substituting less -R for less.
Using the test built into your sh.

Checking compatibility between /bin/echo and builtin echo (if any)...
They are not compatible!  You are probably running ksh on a non-USG system.
I'll have to use /bin/echo instead of the builtin, since Bourne shell doesn't
have echo built in and we may have to run some Bourne shell scripts.  That
means I'll have to use '-n' to suppress newlines now.  Life is ridiculous.

The star should be here-->*
The following message is sponsored by

  Dresden.pm<--The stars should be here.

Dear Perl user, system administrator or package
maintainer, the Perl community sends greetings to
you. Do you (emblematical) greet back [Y/n]? n


Symbolic links are supported.

Checking how to test for symbolic links...
You can test for symbolic links with 'test -h'.


Good, your tr supports [:lower:] and [:upper:] to convert case.
Using [:upper:] and [:lower:] to convert case.
ccache: invalid option -- 'o'
Usage:
    ccache [options]
    ccache compiler [compiler options]
    compiler [compiler options]          (via symbolic link)

Options:
    -c, --cleanup         delete old files and recalculate size counters
                          (normally not needed as this is done automatically)
    -C, --clear           clear the cache completely
    -F, --max-files=N     set maximum number of files in cache to N (use 0 for
                          no limit)
    -M, --max-size=SIZE   set maximum size of cache to SIZE (use 0 for no
                          limit; available suffixes: G, M and K; default
                          suffix: G)
    -s, --show-stats      show statistics summary
    -z, --zero-stats      zero statistics counters

    -h, --help            print this help text
    -V, --version         print version and copyright information

See also <http://ccache.samba.org>.
You need to find a working C compiler.
Either (purchase and) install the C compiler supplied by your OS vendor,
or for a free C compiler try http://gcc.gnu.org/
I cannot continue any further, aborting.
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target `test_harness'. Stop.
Installing /home/lonesome/perl5/perlbrew/build/perl-5.14.0 failed. See /home/lonesome/perl5/perlbrew/build.log to see why.
If you want to force install the distribution, try:

  perlbrew --force install perl-5.14.0

Pretty please? Leon.

perlbrew.pl has several typos

s/has it's own purposes/has its own purposes/ and the footer copyright text is pretty mangled. I would send a patch, but I couldn't find the source on GitHub. ;)

document interaction between perlbrew & cpanm...

Part of the installation for perlbrew is setting config information for CPAN... What is this used for? I see that cpanm is installed in a perlbrew directory. Where do modules installed by this cpanm get installed, just for the currently selected perl?

Thanks.

Maintain separate per-install cpan shell config files

@briandfoy said:

I don't like how CPAN.pm uses the same configuration file for any
invocation no matter the perl or cpan I'm using (e.g. cpan5.12.2
cpan5.14.0 and so on), but I haven't really done anything to fix that.

However, a short term fix might involve you using the -j switch to cpan
to load any config file that you like instead of the one CPAN.pm wants
to use. It's a hack, but that's what there is right now.

Using perlbrew is probably the most common reason to have multiple perls; can we do something to alleviate this headache?

perlbrew install clobbers existing installations

If I install a Perl environment with perlbrew under a certain name, and I already have a Perl environment under that name, perlbrew will overwrite it without a second thought. To reproduce:

$ perlbrew install --as test-instance perl-5.14.0
$ perlbrew install --as test-instance perl-5.8.9

I think perlbrew should die with a message of something like "You already have test-instance installed".

GitHub switched to SSL and cpanm installation fails

*** SEE ISSUE #26 WITH PROPOSED PATCH ***

It seems that GitHub switched to an SSL-only interface, redirecting plain HTTP requests to their HTTPS counterparts. This makes perlbrew fail when downloading cpanm, because HTTP::Lite does not support SSL.

I would personally leave the installation of cpanm out of perlbrew, but that's me.

Cheers,

Flavio.

`exec` command improvements

To provide better interactive / non-interactive use perl installations, there are should be some easy usages for people to run programs with specified perl without a switch/use beforehand.

Suppose a perlbrew root with the following installations:

> perlbrew list
  perl-5.10.1
  perl-5.12.3
* perl-5.14.0
  perl-5.8.9
  /usr/bin/perl (5.10.0)

Then perlbrew should take an additional selector argument before exec, to specify the installation names. For example:

# run myprogram.pl with perl-5.12.3
perlbrew perl-5.12.3 exec  myprogram.pl

# run myprogram.pl with perl-5.12.3 and perl-5.14.0
perlbrew perl-5.12.3,perl-5.14.0 exec  myprogram.pl

# run myprogram.pl with all perls
perlbrew exec  myprogram.pl

# die with error, because perl-5.10.0 is not installed here
perlbrew perl-5.10.0 exec  myprogram.pl

# die with error, also because perl-5.10.0 is not installed here
perlbrew perl-5.12.3,perl-5.10.0 exec  myprogram.pl

The content of selector should be a comma-separated list of installation names, without spaces in between.

If any one or more of the specified installations cannot be found, then perlbrew must die with error messages specifying the missing ones, without executing the command at all.

perlbrew install attempts to install invalid versions

When a version doesn't exist, perlbrew doesn't die properly:


$ perlbrew install perl-5.6.103
Attempting to load conf from /home/mike/perl5/perlbrew/Conf.pm
Use of uninitialized value $dist_tarball in concatenation (.) or string at /home/mike/perl5/perlbrew/bin/perlbrew line 444.
Fetching perl-5.6.103 as /home/mike/perl5/perlbrew/dists/
Use of uninitialized value $dist_path in concatenation (.) or string at /home/mike/perl5/perlbrew/bin/perlbrew line 460.
^C

Support perlbrew on win32 (strawberry)

Strawberry Perl has gcc built-in. I noticed that perlbrew fails to even 'perlbrew init'. It would be cool that i can have perlbrew on win32?

P.S. you need to use $ENV{USERPROFILE} instead of $ENV{HOME} and maybe use File::HomeDir?

Use of uninitialized value $ENV{"HOME"} in concatenation (.) or string at C:/str
awberry/perl/site/lib/App/perlbrew.pm line 11.
Use of uninitialized value $ENV{"HOME"} in concatenation (.) or string at C:/str
awberry/perl/site/lib/App/perlbrew.pm line 124.
Use of uninitialized value $ENV{"SHELL"} in pattern match (m//) at C:/strawberry
/perl/site/lib/App/perlbrew.pm line 195.
Use of uninitialized value in concatenation (.) or string at C:/strawberry/perl/
site/lib/App/perlbrew.pm line 204.
Use of uninitialized value $ENV{"HOME"} in concatenation (.) or string at C:/str
awberry/perl/site/lib/App/perlbrew.pm line 11.
Use of uninitialized value $ENV{"SHELL"} in pattern match (m//) at C:/strawberry
/perl/site/lib/App/perlbrew.pm line 566.
Perlbrew environment initiated, required directories are created under

Check for 404s in http_get

Mirrors return a small HTML file and a 404 if you try to get http://search.cpan.org/CPAN/authors/id/J/JE/JESSE/perl-5.14.0-nonexistent.tar.bz2 etc. We should check for 404s somehow...

$ perl -Ilib ./bin/perlbrew install http://search.cpan.org/CPAN/authors/id/J/JE/JESSE/perl-5.14.0-nonexistent.tar.bz2
Fetching perl-5.14.0 as /home/mike/perl5/perlbrew/dists/perl-5.14.0-nonexistent.tar.bz2
Installing perl-5.14.0 into ~/perl5/perlbrew/perls/perl-5.14.0
This could take a while. You can run the following command on another shell to track the status:

  tail -f ~/perl5/perlbrew/build.log

(cd /home/mike/perl5/perlbrew/build; tar xjf /home/mike/perl5/perlbrew/dists/perl-5.14.0-nonexistent.tar.bz2;cd /home/mike/perl5/perlbrew/build/perl-5.14.0;rm -f config.sh Policy.sh;patchperl;sh Configure -de '-Dprefix=/home/mike/perl5/perlbrew/perls/perl-5.14.0';make ;make test_harness && make install) >> '/home/mike/perl5/perlbrew/build.log' 2>&1 
Installing perl-5.14.0 failed. See /home/mike/perl5/perlbrew/build.log to see why.
If you want to force install the distribution, try:

  perlbrew --force install perl

Perlbrew 0.12 cannot be used from within a bash script

I did a clean install of perlbrew 0.12 and found the following issues.

If one attempts to use perlbrew 0.12 within a bash script, it falls back to its old behavior of creating links in $PERLBREW_ROOT/bin (Issue 1). These links get used instead of the intended version of Perl in the path because perlbrew falls first in the path (Issue 2).


mmusgrove@x4linux:$ perlbrew switch perl-5.12.2
mmusgrove@x4linux:
$ perl v
Can't open perl script "v": No such file or directory
mmusgrove@x4linux:~$ perl -v

This is perl 5, version 12, subversion 2 (v5.12.2) built for i686-linux-thread-multi

Copyright 1987-2010, 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.

mmusgrove@x4linux:~$ perlbrew list
perl-5.10.1

  • perl-5.12.2
    /usr/bin/perl
    mmusgrove@x4linux:$ ls perl5/perlbrew/bin/
    cpanm perlbrew
    mmusgrove@x4linux:
    $ perlbrew switch perl-5.10.1
    mmusgrove@x4linux:~$ perlbrew list
  • perl-5.10.1
    perl-5.12.2
    /usr/bin/perl
    mmusgrove@x4linux:$ ls perl5/perlbrew/bin/
    cpanm perlbrew
    mmusgrove@x4linux:
    $ perl -v

This is perl, v5.10.1 (*) built for i686-linux-thread-multi

Copyright 1987-2009, 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.

mmusgrove@x4linux:$ /bin/bash -c 'perlbrew switch perl-5.12.2'
mmusgrove@x4linux:
$ perlbrew list

  • perl-5.10.1
    perl-5.12.2
    /usr/bin/perl
    mmusgrove@x4linux:$ ls perl5/perlbrew/bin/
    a2p config_data cpan cpanm cpanp-run-perl enc2xs h2ph instmodsh perl perlbug perlivp piconv pod2html pod2man pod2usage podselect psed ptar s2p splain
    c2ph corelist cpan2dist cpanp dprofpp find2perl h2xs libnetcfg perlbrew perldoc perlthanks pl2pm pod2latex pod2text podchecker prove pstruct ptardiff shasum xsubpp
    mmusgrove@x4linux:
    $ perl -v

This is perl 5, version 12, subversion 2 (v5.12.2) built for i686-linux-thread-multi

Copyright 1987-2010, 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.

mmusgrove@x4linux:~$ echo $PATH
/home/mmusgrove/perl5/perlbrew/bin:/home/mmusgrove/perl5/perlbrew/perls/perl-5.10.1/bin:/home/mmusgrove/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

POD has -?|--help twice (--version is needed the second time)

On line 1430, the POD has a duplicate -?| --help where I think you want --version. (Note that it can't be -v| --version since -v is taken already for the verbose option.)

=item B<-?| --help>

prints this help.

=item B<-?| --help>

prints the version of App::perlbrew.

Bash wrapper in version 0.12 doesn't update links

Details:
I was previously using an older version of perlbrew and had a helper script that would call 'perlbrew switch' and 'hash -r'. When I upgraded to perlbrew version 0.12, I noticed that it wasn't working any more. I looked at the code and noticed that perlbrew used a bash wrapper that should run 'hash -r' for me now. Thinking that the changes to perlbrew were preventing my script from functioning, I tried just running 'perlbrew switch' and found that it wasn't updating the links.

Summary:
When you run 'perlbrew switch', the bash wrapper that gets used does not update the links. This results in perlbrew showing that it has switched versions of Perl when it has not.

The workaround is to run 'env perlbrew switch' instead.

No documentation in man perlbrew

There's no documentation in stalled for man perlbrew - the same documentation available via perlbrew --help or perldoc perlbrew should be in man perlbrew.

perlbrew doesn't handle network errors gracefully

If network connectivity isn't available or an exception is encountered, perlbrew steams on ahead.

  • perlbrew available prints nothing; I think it should at least say "unable to retrieve list of perls"
  • perlbrew install perl-5.14.0 (or some other release) complains and exits, which is ok; but if the relevant tarball is found under dists/, it still fails; I think it should fallback to building the existing distribution.
  • perlbrew mirror complains that you haven't selected a mirror. I think a better error message should be presented.
  • perlbrew install perl-blead results in an error message from tar.
  • perlbrew install-cpanm blows away the existing cpanm, and replaces it with an empty file.

To reproduce and test for these issues, add the following to your /etc/hosts:

127.0.0.1 perl5.git.perl.org www.cpan.org search.cpan.org github.com

After that, just run the commands I mentioned above.

cannot install perl with perlbrew due to lib version mismatch

Hi,

I've just installed perlbrew on my Mac OS X 10.5 where I have previously installed perl 5.10.1 (in /usr/local/) along with the default perl 5.8.8 (in /usr/bin). When I try to install perl 5.12 (or 5.13, the only two I've tried) it fails with the output below. I'd rather not force install and if I do I'm not sure it would even work. Any ideas?

Thank you.

...
Making all in ext/Errno
 /usr/bin/make all PERL_CORE=1 LIBPERL_A=libperl.a
../../miniperl "-I../../lib" "-I../../lib" Errno_pm.PL Errno.pm
Perl lib version (5.12.1) doesn't match executable version (v5.10.1) at ../../lib/Config.pm line 50.
Compilation failed in require at /usr/local/lib/perl5/5.10.1/darwin-2level/DynaLoader.pm line 25.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/5.10.1/darwin-2level/DynaLoader.pm line 25.
Compilation failed in require at /usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/IO/Tty.pm line 12.
Compilation failed in require at /usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/IO/Pty.pm line 7.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/IO/Pty.pm line 7.
Compilation failed in require at /usr/local/lib/perl5/site_perl/5.10.1/App/Cope/Pty.pm line 22.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.10.1/App/Cope/Pty.pm line 22.
Compilation failed in require at /usr/local/lib/perl5/site_perl/5.10.1/App/Cope.pm line 22.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.10.1/App/Cope.pm line 22.
Compilation failed in require at /usr/local/lib/perl5/site_perl/5.10.1/auto/share/dist/Cope/cc line 2.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.10.1/auto/share/dist/Cope/cc line 2.
No error definitions found at Errno_pm.PL line 228.
make[1]: *** [Errno.pm] Error 255
Unsuccessful make(ext/Errno): code=512 at make_ext.pl line 449.
make: *** [ext/Errno/pm_to_blib] Error 2

perlbrew thinks /usr/bin/perl, /usr/bin//perl are different

woosley@woosley:~/code/App-perlbrew/lib$/usr/local/bin/perlbrew list

  • custom
    perl-5.14.0-RC1
    /usr/bin//perl (5.10.1)
    /usr/bin/perl (5.10.1)
    This is because $PATH has /usr/bin/, /usr/bin both.

a quick hack would be add another map into sub installed_perl{} line 756 like this
for ( uniq grep { -f $_ && -x $_ } map {s$//+$/$g, $} map { "$/perl" } split(":", $self->env('PATH')) ) {

sourcing perlbrew's etc/bashrc resets PATH to :

On a Debian squeeze system, installing perlbrew view cpanm, and then running

 perlbrew init

results in an ~/perl5/perlbrew/etc/bashrc that, when sourced, resets $PATH to :, making all future program invocations rather painful.

p6eval@host04:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
p6eval@host04:~$ source perl5/perlbrew/etc/bashrc 
p6eval@host04:~$ echo $PATH
:

This happens with version 0.11 of App::perlbrew.

'perlbrew env' should show PERLBREW_PERL

% perlbrew env
export PERLBREW_VERSION=0.16
export PERLBREW_PATH=/home/daniel/perl/bin
export PERLBREW_ROOT=/home/daniel/perl

% echo $PERLBREW_PERL
perl-5.12.3

I think that perlbrew env should also show the value of PERLBREW_PERL-- i.e. it should show all environment variables set by perlbrew.

Run 'perlbrew init' automagically

Why not run 'perlbrew init' automagically the first time the user tries to do anything perlbrew-ish, instead of having it as an extra manual step.

a `switch command` doesn't work.

Leonardoui-iMac:bin dalinaum$ ls
cpanm       perlbrew
Leonardoui-iMac:bin dalinaum$ ls -al
total 384
drwxr-xr-x   4 dalinaum  staff     136  1 29 16:42 .
drwxr-xr-x  10 dalinaum  staff     340  1 29 16:17 ..
-rwxr-xr-x   1 dalinaum  staff  171359  1 29 13:27 cpanm
-rwxr-xr-x   1 dalinaum  staff   24014  1 29 14:49 perlbrew
Leonardoui-iMac:bin dalinaum$ perlbrew list
  perl-5.12.2
  * perl-5.12.3
    /usr/bin/perl (5.10.0)
    Leonardoui-iMac:bin dalinaum$ ls
    cpanm       perlbrew
    Leonardoui-iMac:bin dalinaum$ perlbrew list
      perl-5.12.2
      * perl-5.12.3
        /usr/bin/perl (5.10.0)
    Leonardoui-iMac:bin dalinaum$ perl -v

    This is perl 5, version 12, subversion 3 (v5.12.3) built for darwin-thread-multi-2level

    Copyright 1987-2010, 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.

    Leonardoui-iMac:bin dalinaum$ perlbrew switch perl-5.12.2
    Leonardoui-iMac:bin dalinaum$ perlbrew list
    * perl-5.12.2
      perl-5.12.3
        /usr/bin/perl (5.10.0)
        Leonardoui-iMac:bin dalinaum$ perl -v

        This is perl 5, version 12, subversion 2 (v5.12.2) built for darwin-2level

        Copyright 1987-2010, 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.

        Leonardoui-iMac:bin dalinaum$ ls -l
        total 384
        -rwxr-xr-x  1 dalinaum  staff  171359  1 29 13:27 cpanm
        -rwxr-xr-x  1 dalinaum  staff   24014  1 29 14:49 perlbrew
        Leonardoui-iMac:bin dalinaum$ perlbrew -f switch perl-5.12.3
        Leonardoui-iMac:bin dalinaum$ ls -l
        total 688
        lrwxr-xr-x  1 dalinaum  staff      52  1 29 16:44 a2p -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/a2p
        lrwxr-xr-x  1 dalinaum  staff      53  1 29 16:44 c2ph -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/c2ph
        lrwxr-xr-x  1 dalinaum  staff      60  1 29 16:44 config_data -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/config_data
        lrwxr-xr-x  1 dalinaum  staff      57  1 29 16:44 corelist -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/corelist
        lrwxr-xr-x  1 dalinaum  staff      53  1 29 16:44 cpan -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/cpan
        lrwxr-xr-x  1 dalinaum  staff      58  1 29 16:44 cpan2dist -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/cpan2dist
        -rwxr-xr-x  1 dalinaum  staff  171359  1 29 13:27 cpanm
        lrwxr-xr-x  1 dalinaum  staff      54  1 29 16:44 cpanp -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/cpanp
        lrwxr-xr-x  1 dalinaum  staff      63  1 29 16:44 cpanp-run-perl -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/cpanp-run-perl
        lrwxr-xr-x  1 dalinaum  staff      56  1 29 16:44 dprofpp -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/dprofpp
        lrwxr-xr-x  1 dalinaum  staff      55  1 29 16:44 enc2xs -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/enc2xs
        lrwxr-xr-x  1 dalinaum  staff      58  1 29 16:44 find2perl -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/find2perl
        lrwxr-xr-x  1 dalinaum  staff      53  1 29 16:44 h2ph -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/h2ph
        lrwxr-xr-x  1 dalinaum  staff      53  1 29 16:44 h2xs -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/h2xs
        lrwxr-xr-x  1 dalinaum  staff      58  1 29 16:44 instmodsh -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/instmodsh
        lrwxr-xr-x  1 dalinaum  staff      58  1 29 16:44 libnetcfg -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/libnetcfg
        lrwxr-xr-x  1 dalinaum  staff      59  1 29 16:44 perl -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/perl5.12.3
        -rwxr-xr-x  1 dalinaum  staff   24014  1 29 14:49 perlbrew
        lrwxr-xr-x  1 dalinaum  staff      56  1 29 16:44 perlbug -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/perlbug
        lrwxr-xr-x  1 dalinaum  staff      56  1 29 16:44 perldoc -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/perldoc
        lrwxr-xr-x  1 dalinaum  staff      56  1 29 16:44 perlivp -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/perlivp
        lrwxr-xr-x  1 dalinaum  staff      59  1 29 16:44 perlthanks -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/perlthanks
        lrwxr-xr-x  1 dalinaum  staff      55  1 29 16:44 piconv -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/piconv
        lrwxr-xr-x  1 dalinaum  staff      54  1 29 16:44 pl2pm -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/pl2pm
        lrwxr-xr-x  1 dalinaum  staff      57  1 29 16:44 pod2html -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/pod2html
        lrwxr-xr-x  1 dalinaum  staff      58  1 29 16:44 pod2latex -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/pod2latex
        lrwxr-xr-x  1 dalinaum  staff      56  1 29 16:44 pod2man -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/pod2man
        lrwxr-xr-x  1 dalinaum  staff      57  1 29 16:44 pod2text -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/pod2text
        lrwxr-xr-x  1 dalinaum  staff      58  1 29 16:44 pod2usage -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/pod2usage
        lrwxr-xr-x  1 dalinaum  staff      59  1 29 16:44 podchecker -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/podchecker
        lrwxr-xr-x  1 dalinaum  staff      58  1 29 16:44 podselect -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/podselect
        lrwxr-xr-x  1 dalinaum  staff      54  1 29 16:44 prove -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/prove
        lrwxr-xr-x  1 dalinaum  staff      53  1 29 16:44 psed -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/psed
        lrwxr-xr-x  1 dalinaum  staff      56  1 29 16:44 pstruct -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/pstruct
        lrwxr-xr-x  1 dalinaum  staff      53  1 29 16:44 ptar -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/ptar
        lrwxr-xr-x  1 dalinaum  staff      57  1 29 16:44 ptardiff -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/ptardiff
        lrwxr-xr-x  1 dalinaum  staff      52  1 29 16:44 s2p -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/s2p
        lrwxr-xr-x  1 dalinaum  staff      55  1 29 16:44 shasum -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/shasum
        lrwxr-xr-x  1 dalinaum  staff      55  1 29 16:44 splain -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/splain
        lrwxr-xr-x  1 dalinaum  staff      55  1 29 16:44 xsubpp -> /Users/dalinaum/perl5/perlbrew/perls/current/bin/xsubpp

        Leonardoui-iMac:bin dalinaum$ perl -v

        This is perl 5, version 12, subversion 3 (v5.12.3) built for darwin-thread-multi-2level

        Copyright 1987-2010, 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.

        Leonardoui-iMac:bin dalinaum$ perlbrew switch perl-5.12.2
        Leonardoui-iMac:bin dalinaum$ perl -v

        This is perl 5, version 12, subversion 3 (v5.12.3) built for darwin-thread-multi-2level

        Copyright 1987-2010, 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.

        Leonardoui-iMac:bin dalinaum$ 

Sorry for my poor english.

perlbrew -f switch <dist> or perl perlbrew switch <dist> make symbolic links. It cause a problem of using a env command. So a switch command doesn't work.

TODO: Remove `current` symlink

The switch command now use a global symlink inside $PERLBREW_ROOT to keep tracking current activated perl. The problem with this approach is that it is not friendly when multiple users are sharing the same PERLBREW_ROOT.

To solve this, perlbrew switch should be re-written completely in bash, it should save the result in ~/.perlbrew/init, which is a personal directory.

There are several RT issues related to switch, that should be taken care of after the rewrite:

Perlbrew has gotten worse for shared installations

My use case for perlbrew is that for almost everything I'm replacing the system perl on my server with a perlbrew maintained installation.

I install modules & perlbrew versions under the user v-perlbrew hosted in /home/v-perlbrew, but other users (e.g. cronjobs etc) use that perl.

It used to be that I could just add something like this to my cronjobs:

PATH=/home/v-perlbrew/perl5/perlbrew/bin:/home/v-perlbrew/perl5/perlbrew/perls/current/bin:/bin:/usr/bin

But now that perlbrew seems to no longer create the /home/v-perlbrew/perl5/perlbrew/bin symlink I have to now maintain it myself, e.g.:

sudo rm -rfv /home/v-perlbrew/perl5/perlbrew/bin
sudo ln -sf /home/v-perlbrew/perl5/perlbrew/perls/perl-5.14.0/bin /home/v-perlbrew/perl5/perlbrew/bin

And furthermore, users that are not cronjobs had to have this in their .bashrc:

test -f ~v-perlbrew/perl5/perlbrew/etc/bashrc && source ~v-perlbrew/perl5/perlbrew/etc/bashrc

Changed to:

test -f ~v-perlbrew/perl5/perlbrew/etc/bashrc && HOME=/home/v-perlbrew source ~v-perlbrew/perl5/perlbrew/etc/bashrc

Since the ~/perl5/perlbrew/etc/bashrc now makes the assumption (which it didn't before) that ~/perl5 can be found under $HOME, as opposed to having the full paths hardcoded in.

Proposed fixes to make this workflow work:

  • Instead of looking under $HOME look under a path relative to the bashrc being sourced
  • Provide an option to maintain the "bin" symlink again, or put it back in by default.

Thanks.

Proxy support in _http_get

I think this will help many people over proxy servers.
$ua->proxy($ENV{http_proxy}) if $ENV{http_proxy};

Feature request: configuration file

I think perlbrew's usefulness would be further enhanced by a configuration file; one could even leverage the existing Conf.pm that is used for mirror selection. This could come in handy if I want to make sure all the perl environments I install have a certain set of compilation flags; for example -Doptimize=-O2 -Dman1dir=' ' -Dman3dir=' '. I know I could accomplish this with shell aliasing, but then I'd lose those settings if I ran perlbrew from within a script.

Also, I think that the settings for a build could be organized into profiles; that way, I could have a default profile with the example settings from above, and a debug profile with debugging enabled in the interpreter and using Perl's malloc for Devel::Peek::mstat. If I wanted to install a Perl interpreter for version 5.8.9 for debugging, I could simply do this:

perlbrew install --profile debugging perl-5.8.9 --as perl-5.8.9-debug

Thoughts?

On test failure, offer to force installation

After a perl's test suite fails, instead of making the user re-build the perl, re-run the tests and then force installation, we should offer a prompt that explains that the user should review the log, and decide whether they want to force installation right now.

Ubuntu 11.04 and perlbrew installation problems

Hi,

I am unable to fix it from past 3 days and I desperately need someone to help me on this. I installed perlbrew like a charm on Ubuntu 10.10 and it worked great. But now I upgraded to 11.04 and am finding issues. I know that the issue is with GCC linker options -lm (linking math.h) and -lrt (time.h). Here are the errors. Can some one tell me how I can fix this problem ?

pp_sys.c:(.text+0x796): undefined reference to fmod' pp_sys.c:(.text+0x7bf): undefined reference tofmod'
pp_sys.o: In function Perl_pp_gmtime': pp_sys.c:(.text+0xc602): undefined reference tofloor'
pp_pack.o: In function S_pack_rec': pp_pack.c:(.text+0x61fa): undefined reference tofloor'
pp_pack.c:(.text+0x621b): undefined reference to floor' pp_pack.c:(.text+0x623a): undefined reference tofloor'
collect2: ld returned 1 exit status
make: *** [miniperl] Error 1

Thanks!

Error with HTTP::Lite and https support for Github

Hi,

Github switched to HTTPS only and Perlbrew uses HTTP::Lite to fetch cpanm at some point. The following warning is printed now:

Only http is supported by HTTP::Lite at /home/melo/perl5/perlbrew/bin/perlbrew line 149.
Fail to get https://github.com/miyagawa/cpanminus/raw/master/cpanm (error: ) at /home/melo/perl5/perlbrew/bin/perlbrew line 1433.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.