Giter VIP home page Giter VIP logo

lib-byversion's Introduction

NAME
    lib::byversion - add paths to @INC depending on which version of "perl"
    is running.

VERSION
    version 0.001001

SYNOPSIS
        PERL5OPT="-Mlib::byversion='$HOME/Foo/Bar/%V/lib/...'"

    or alternatively

        use lib::byversion "/some/path/%V/lib/...";

DESCRIPTION
    So you have >1 Perl Installs. You have >1 Perl installs right? And you
    switch between running them how?

    Let me guess, somewhere you have code that sets a different value for
    PERL5LIB depending on what Perl you're using. Oh you use "perlbrew"?
    <http://grep.cpan.me/?q=PERL5LIB+dist=App-perlbrew>

    This is a slightly different approach:

    1. Set up your user-land PERL5LIB directories in a regular pattern
    differing only by "perl" version
            $HOME/Foo/Bar/5.16.0/lib/...
            $HOME/Foo/Bar/5.16.1/lib/...
            $HOME/Foo/Bar/5.16.2/lib/...

    2. Set the following in your %ENV
            PERL5OPT="-Mlib::byversion='$HOME/Foo/Bar/%V/lib/...'"

    3. Done!
        The right PERL5LIB gets loaded based on which "perl" you use.

    Yes, yes, catch 22, "lib::byversion" and its dependencies need to be in
    your lib to start with.

    O.k. That is a problem, slightly. But assuming you can get that in each
    "perl" install somehow, you can load each "perl"'s user library
    directories magically with this module once its loaded.

    And "assuming you can get that in each "perl" install somehow" =~ with a
    bit of luck, this feature or something like it might just be added to
    Perl itself, as this is just a prototype idea to prove it works ( or as
    the case may be, not ).

    And even if that never happens, and you like this module, you can still
    install this module into all your "perl"'s and keep a separate
    "user-PERL5LIB-per-perl" without having to use lots of scripts to hold
    it together, and for System Perls, you may even be fortunate enough to
    get this module shipped by your "OS" of choice. Wouldn't that be dandy.

IMPORT
        use lib::byversion $param
        lib::byversion->import($param)
        perl -Mlib::byversion=$param

    etc.

    "lib::byversion" expects one parameter, a string path containing
    templated variables for versions.

    Current defined parameters include:

    %V  This is an analogue of $^V except :

        it should work on even "perl"s that didn't have $^V, as it converts
        it from $] with version.pm
        it lacks the preceding "v", because this is more usually what you
        want and its easier to template it in than take it out.

        Example:

            %V = 5.16.9

    %v  This is the same as $] on your Perl.

        Example:

            %v = 5.016009

    More may be slated at some future time, e.g.: to allow support for
    components based on "git" "sha1"'s, but I figured to upload something
    that works before I bloat it out with features nobody will ever use.

AUTHOR
    Kent Fredric <[email protected]>

COPYRIGHT AND LICENSE
    This software is copyright (c) 2013 by Kent Fredric
    <[email protected]>.

    This is free software; you can redistribute it and/or modify it under
    the same terms as the Perl 5 programming language system itself.

lib-byversion's People

Contributors

kentfredric avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.