Question

I asked this question on perlmonks, and have made limited progress so I will ask here. I installed perl 5.16.0, threaded, on Mac OS X 10.7.5, using perlbrew. Now, when I try to transfer modules to the new install, it fails with a message that I don't understand. Below are commands I used and output.

$ perlbrew install --as perl-5.16.0t -Dusethreads perl-5.16.0

Then, following a post on perlmonks:

$ perldoc -t perllocal | perl -lane'/"Module"/ && print $F[-1]' | sort -u >/tmp/pms

$ perlbrew switch perl-5.16.0t

$ cpanm -v </tmp/pms &>>/tmp/inst.log & tail -f /tmp/inst.log

I then tried these commands as a simple check, and got output I can't begin to fathom:

$ perl -e 1 -MFile::Find
  dyld: lazy symbol binding failed: Symbol not found: _Perl_Istack_sp_ptr
  Referenced from: /Users/abualiga/perl5/lib/perl5/darwin-thread-multi-2level/auto/Cwd/Cwd.bundle
  Expected in: flat namespace

  dyld: Symbol not found: _Perl_Istack_sp_ptr
  Referenced from: /Users/abualiga/perl5/lib/perl5/darwin-thread-multi-2level/auto/Cwd/Cwd.bundle
  Expected in: flat namespace

  Trace/BPT trap: 5

$ perldoc File::Find
  dyld: lazy symbol binding failed: Symbol not found: _Perl_Istack_sp_ptr
  Referenced from: /Users/abualiga/perl5/lib/perl5/darwin-thread-multi-2level/auto/Cwd/Cwd.bundle
  Expected in: flat namespace

  dyld: Symbol not found: _Perl_Istack_sp_ptr
  Referenced from: /Users/abualiga/perl5/lib/perl5/darwin-thread-multi-2level/auto/Cwd/Cwd.bundle
  Expected in: flat namespace

  Trace/BPT trap: 5

I uninstalled perl-5.16.0t and removed folder perlbrew and the line from .bash_profile, so now I am back to system perl 5.12.3. I would like to know how to do this though, to have multiple perls in my home directory, and not have to use ActiveState.

Was it helpful?

Solution

Did you install perlbrew with default settings in the default directory (perl5/perlbrew)? Reinstall perlbrew and switch to your preferred perl and check the following:

First, do you have cpanm installed in perlbrew? "which cpanm" will tell you which one you are using. It should be located in a directory with a path ending in "perlbrew/bin". If not, you can install it with

perlbrew install-cpanm

Also, is the line in your bash_profile something like "source ~/perl5/perlbrew/etc/bashrc"? Is it the correct path for that perlbrew bashrc file? Did you restart your terminal after editing your bash_profile? What's in your @INC? To check:

perl -e 'print join "\n", @INC'

If perlbrew is installed correctly, there should only be subdirectories of your perlbrew directory in @INC.

From your error messages, it looks like the perlbrew perl is looking for that module and finding one built against another perl located in "/Users/abualiga/perl5/lib" which isn't compatible. Perlbrew perl's modules are usually located somewhere like "~/perl5/perlbrew/perls/perl-5.16.3/lib". Which means either you didn't install those modules properly for the particular perlbrew perl you are using, or something is wrong with the path/@INC. If it's the latter, something is wrong with the perlbrew bashrc script (I know they fixed a bug in the latest version - 0.61 - of perlbrew). Though, if you didn't install perlbrew in the default way, then you may need to fix the path yourself.

Also, in the future, if you would like to transfer modules between different perls installed with perlbrew, these instructions may help.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top