http://www.perlmonks.org?node_id=953822

kcott has asked for the wisdom of the Perl Monks concerning the following question:

G'day Monks,

I'm currently using Perl 5.14.2 via App::perlbrew. This version of Perl was not compiled with thread support - I'd like to change this. I've researched online documentation and formulated a plan of attack. I still have a few questions - see the individual steps below. I'd appreciate any other advice or comments.

The steps I'm planning to follow are:

1. Backup home directory and /usr/local/bin/. I believe this captures everything I'd need to restore the current setup. Is this correct?

2. Upgrade Perlbrew (I have v0.30; latest is v0.41).

perlbrew self-upgrade

3. Rename current Perlbrew Perl.

perlbrew alias create perl-5.14.2 perl-5.14.2_NO_THREADS

I note this has an -f option (i.e. perlbrew alias [-f] create <name> <alias>) but can't find any documentation as to its purpose. Can anyone tell me what it does?

4. Install Perl 5.14.2 with thread support.

perlbrew install -v perl-5.14.2 -Dusethreads --as perl-5.14.2_WITH +_THREADS

I've guessed the position of the -v option - am I right? I see other options for install documented in perlbrew. Do I need any of these?

5. Default to newly installed threaded Perl.

perlbrew switch perl-5.14.2_WITH_THREADS

6. Local tasks such as resetting my /usr/local/bin/perl symlink and testing existing applications still work.

Additional information which may be of use:

System: Apple Mac Pro running Mac OS X 10.7.3

Users: just me

$ perl -V Summary of my perl5 (revision 5 version 14 subversion 2) configuration +: Platform: osname=darwin, osvers=11.2.0, archname=darwin-2level uname='darwin ganymede 11.2.0 darwin kernel version 11.2.0: tue au +g 9 20:54:00 pdt 2011; root:xnu-1699.24.8~1release_x86_64 x86_64 ' config_args='-de -Dprefix=/Users/ken/perl5/perlbrew/perls/perl-5.1 +4.2' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=und +ef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-common -DPERL_DARWIN -fno-strict-aliasing +-pipe -fstack-protector', optimize='-O3', cppflags='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fs +tack-protector' ccversion='', gccversion='4.2.1 (Based on Apple Inc. build 5658) ( +LLVM build 2336.1.00)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +6 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-prot +ector' libpth=/usr/lib libs=-ldbm -ldl -lm -lutil -lc perllibs=-ldl -lm -lutil -lc libc=, so=dylib, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -fst +ack-protector' Characteristics of this binary (from libperl): Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_I +NT USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF Built under darwin Compiled at Oct 23 2011 21:06:51 %ENV: PERL5LIB="/Users/ken/local/lib/perl" PERLBREW_BASHRC_VERSION="0.30" PERLBREW_HOME="/Users/ken/.perlbrew" PERLBREW_PATH="/Users/ken/perl5/perlbrew/bin:/Users/ken/perl5/perl +brew/perls/perl-5.14.2/bin" PERLBREW_PERL="perl-5.14.2" PERLBREW_ROOT="/Users/ken/perl5/perlbrew" PERLBREW_VERSION="0.30" @INC: /Users/ken/local/lib/perl /Users/ken/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/d +arwin-2level /Users/ken/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2 /Users/ken/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/darwin-2lev +el /Users/ken/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2 . $ perlbrew list * perl-5.14.2 /opt/local/bin/perl (5.12.3) <--- MacPorts Perl /usr/bin/perl (5.12.3) <--- System Perl /usr/local/bin/perl (5.14.2) <--- Perlbrew Perl (symlink) $ ls -l /usr/local/bin/perl lrwxr-xr-x 1 root wheel 52 29 Oct 04:30 /usr/local/bin/perl -> /Use +rs/ken/perl5/perlbrew/perls/perl-5.14.2/bin/perl $ which perl /Users/ken/perl5/perlbrew/perls/perl-5.14.2/bin/perl

Update: s/-Duseithreads/-Dusethreads/ (thanks ikegami).

Update 2014: I wrote this post in early 2012. Beyond the immediate replies at that time, there've been responses in both 2013 and 2014 with additional and updated information. It's good to see this node is still being read (and, hopefully, found to be useful). Here's my latest perlbrew install command (for Perl v5.18.1):

$ perlbrew install -v http://search.cpan.org/CPAN/authors/id/R/RJ/RJBS +/perl-5.18.1.tar.gz -Dusethreads --as perl-5.18.1t

-- Ken