• Perl Virtual Environments

    From moogyd@21:1/5 to All on Fri Jan 8 23:55:37 2021
    Hi,
    I am not an expert in Perl, so forgive me if this is a FAQ somewhere that I cannot find.
    Is there something similar to Python virtualenv i.e. I can have multiple (local) Perl installations (versions, libraries) in parallel, and select which to use.

    A quick google shows plenv (https://github.com/tokuhirom/plenv) and plbrew (https://perlbrew.pl/), and some others (App::VirtualEnv)

    Can anyone provide any experiences and comments, considering that I am not expert in the details of Perl (libraries, paths, cpan).

    Thanks in advance,
    Steven

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rainer Weikusat@21:1/5 to moogyd on Sun Jan 10 20:02:20 2021
    moogyd <moogyd@yahoo.co.uk> writes:
    I am not an expert in Perl, so forgive me if this is a FAQ somewhere that I cannot find.
    Is there something similar to Python virtualenv i.e. I can have
    multiple (local) Perl installations (versions, libraries) in parallel,
    and select which to use.

    A quick google shows plenv (https://github.com/tokuhirom/plenv) and
    plbrew (https://perlbrew.plF/), and some others (App::VirtualEnv)

    Can anyone provide any experiences and comments, considering that I am
    not expert in the details of Perl (libraries, paths, cpan).

    Both of these are just wrappers for existing facilities: It's possible
    to specify the set of library directories etc of a perl version when configuring a source tree for compiling it. Hence, there can as many
    different version of Perl coexisting on the same system as one wants to
    use.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kang-min Liu@21:1/5 to moogyd on Fri Jan 22 11:16:56 2021
    moogyd <moogyd@yahoo.co.uk> writes:

    Hi,
    I am not an expert in Perl, so forgive me if this is a FAQ somewhere that I cannot find.
    Is there something similar to Python virtualenv i.e. I can have
    multiple (local) Perl installations (versions, libraries) in parallel,
    and select which to use.

    A quick google shows plenv (https://github.com/tokuhirom/plenv) and
    plbrew (https://perlbrew.pl/), and some others (App::VirtualEnv)


    Hi moogyd,

    In terms of Perl installations perlbrew and plenv is almost identical --
    they are both wrappers for the `Configure` script so all installations
    goes under a specific dir.

    The difference is how you use those installations.

    Both perlbrew and plenv provide some shell-wrappers that alters PATH
    so that whatever the "activated" installation can be found in PATH -- preferrably before system-y paths such as /usr/bin

    Both isolate their Perl installations so nothing should be related to
    system perl. However, both tool kickstart the Configure script and that
    might end up linking to libs under /usr/lib, so those installations
    might not be self-contained.

    In addition, plenv implements project-local version-switching by
    allowing you to put a `.perl_version` file inside a dir, and whenever
    you cd to that dir, `perl` becomes whatever that `.perl_version`
    specifies. This is realized by having shims which is a shell wrapper
    script named exactly `perl` that internally finds the right perl
    installation and re-exec the actual `perl`. -- this is no supported by perlbrew.

    iirc plenv provides no special isolation for libraries (CPAN modules)

    perlbrew provides isolations of different set of libraris (by `perlbrew
    lib`). Internally these are done via local::lib and therfore perlbrew
    also munge your PERL5LIB var (it would be the best if you leave this var
    empt)

    In terms of CPAN modules that requires C compiler such as Net::SSLeay,
    related librires must exist in the system before that can be compiled
    and installed.

    I hope that answers your question.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)