Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Change Namespace of Package

by haukex (Chancellor)
on Sep 14, 2019 at 07:03 UTC ( #11106162=note: print w/replies, xml ) Need Help??


in reply to Change Namespace of Package

It sounds like you don't need to use both version 7 and 8 from the same script, which makes things easier (if you did, that'd make things pretty complicated). You could install the modules to different, custom library paths. Hopefully, the modules use one of the standard Perl installation procedures: If it's ExtUtils::MakeMaker, run perl Makefile.PL INSTALL_BASE=/path/for/v7 resp. /path/for/v8 (the paths where you want to have the libraries installed); if it's Module::Build, run perl Build.PL --install_base /path/for/v7 resp. v8. Then, in your Perl scripts, you can point them at the correct library path, for example with use lib '/path/for/v7/lib/perl5' before loading the module.

Replies are listed 'Best First'.
Re^2: Change Namespace of Package
by elliott9 (Novice) on Sep 14, 2019 at 22:04 UTC
    This is exactly what I needed! I tried for a while to only install only one version to a custom installation location but had issues. Once I gave up on that placed both versions of the package in a custom location (as you recommended) things worked perfectly! Wahoo! Much thanks!
Re^2: Change Namespace of Package
by ikegami (Pope) on Sep 15, 2019 at 21:35 UTC

    I prefer to install two builds of Perl rather than much with additional include paths. It's super easy with perlbrew, and you don't have to worry about setting the environment right or about different dependencies or version of dependencies, etc.

      Can perlbrew also replicate the installation of my prefered modules, like Data::Dump ?

      update

      OK that's rather an issue when having different Perl versions, because otherwise one can share the same lib path.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

        I'm not sure what you're asking. perlbrew doesn't replicate installations. It's a Perl installer and a path-management utility for the shell. But once it installs a build of Perl, you are free to install Data::Dump for it.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11106162]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2019-12-13 11:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?