gugod / app-perlbrew Goto Github PK
View Code? Open in Web Editor NEWManage perl installations in your $HOME
Home Page: https://perlbrew.pl
License: Other
Manage perl installations in your $HOME
Home Page: https://perlbrew.pl
License: Other
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.) If you need to install perlbrew using a Perl that isn't either /usr/bin/perl or /usr/local/bin/perl, set and export the environment variable PERLBREW_SYSTEM_PERL and then install as described above. Note that you must not use a perlbrew-managed perl. 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.
Specs:
Debian 6 Squeeze and Ubuntu 10.10 Maverick
Trace:
$ sudo cpan
cpan> install App::Perlbrew
...
$ perlbrew install perl-5.12.1
...
$ perlbrew switch perl-5.12.1
$ perlbrew switch
Currently switched to perl-5.12.1
$ perl -v
5.10.1
Lies!!
I can't quite put it, but basically I tried to install perl-5.6.2 for testing, and got bitten by this: http://www.gossamer-threads.com/lists/perl/porters/225634
I apparently just need to patch makefile, but is there a way to do this with perlbrew?
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.
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.
Devel::PatchPerl was just updated to fix an issue causing test failures on perl 5.14 (and likely some versions of 5.13).
Here is the closed issue:
bingos/devel-patchperl#3 (comment)
The change was small enough that I simply edited my own ~/perl5/perlbrew/bin/patchperl
but please update the patchperl that perlbrew uses.
Thanks!
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?
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.
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$ perl v
mmusgrove@x4linux:
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
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'$ perlbrew list
mmusgrove@x4linux:
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
% 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
.
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.
If network connectivity isn't available or an exception is encountered, perlbrew steams on ahead.
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.
When you use -U, it actually runs it under -D as well.
When I ran:
perlbrew install perl-5.13.3 -U something
it actually ran:
[...]
Configure [...] -D-Usomething [...]
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.
The provided cshrc doesn't source ~/.perlbrew/init, so $PERLBREW_ROOT is never populated.
Undefined subroutine &Getopt::Long::GetOptionsFromArray called at /usr/src/perl/
cpanplus/5.8.8/build/App-perlbrew-0.10/blib/lib/App/perlbrew.pm line 50.
Needs adding to the Makefile.PL
*** 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.
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 to
fmod'
pp_sys.o: In function Perl_pp_gmtime': pp_sys.c:(.text+0xc602): undefined reference to
floor'
pp_pack.o: In function S_pack_rec': pp_pack.c:(.text+0x61fa): undefined reference to
floor'
pp_pack.c:(.text+0x621b): undefined reference to floor' pp_pack.c:(.text+0x623a): undefined reference to
floor'
collect2: ld returned 1 exit status
make: *** [miniperl] Error 1
Thanks!
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.
using "make test_harness" means the "-j" options from HARNESS_OPTIONS will be used.
Support for it was added in 1167a30e646ca68516b6d6fe00c979246aa8df3a in perl.git, so it's OK for perl-5.7.3 or later.
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.
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.
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.
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:
Thanks.
Minor typo. :-) Is the source for the website available somewhere?
I want to install 5.14.0-RC2 from a particular URL, it'd be great if:
perlbrew install http://specific-cpan-mirror/perl-5.14.0-RC2.tar.gz
worked :)
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.
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.
I think this will help many people over proxy servers.
$ua->proxy($ENV{http_proxy}) if $ENV{http_proxy};
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
Like it says on the tin - this needs to be documented.
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?
There's no documentation in stalled for man perlbrew
- the same documentation available via perlbrew --help
or perldoc perlbrew
should be in man perlbrew
.
woosley@woosley:~/code/App-perlbrew/lib$/usr/local/bin/perlbrew list
a quick hack would be add another map into sub installed_perl{} line 756 like this
for ( uniq grep { -f $_ && -x
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
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
Command: perlbrew install perl-blead
The blead perl snapshot can be reached at
http://perl5.git.perl.org/perl.git/snapshot/blead.tar.gz
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.
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".
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
Devel::PatchPerl was updated.
Please regen patchperl :)
the patchperl downloaded from
https://gist.github.com/raw/962406/eeffe0e4acf0cc6ff1fa7bc60586d3dc26e3f41a/patchperl
has a shebang line of
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
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.
perl-modern = -Dusethreads
This happened to me more than once when installing stuff like Padre that need threading. I wasted 10 min of my life to run it again :)
perl-blead = latest trunk
perl-dev = latest released development release
perl-stable = latest stable perl
@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?
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:
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
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. ;)
Pull request #77 has done some of this work.
Maybe the "perl-" prefix can be omitted in general when used in command line.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.