The cpanminus people (https://github.com/miyagawa/cpanminus) have this cool idea where you can just use the script hosted from github without even having to download it. So you can do:
curl -L cpanmin.us | perl - --help
and just use it. This made me wonder if I could not do something similar with the script I recently blogged about.
curl -L bit.ly/byYuxs | perl - -a $LOCALLIB_DIR
which is a little script (https://github.com/jjn1056/bootstrap-locallib.pl) that will bootstrap local::lib for you and install cpanminus so you can play with it. Use like:
curl -L bit.ly/byYuxs | perl - -a mylocallib
and it will run off and setup a properly bootstrapped local::lib in $HOME/mylocallib
I don't have a sweet hostname for this, but I figured with the pace of cpanminus development it will be obsolete shortly :)
Be aware that I install the CPAN version of cpanm, not github master, so is possible some features may lag from the most recent advertisements. However for the three things I use CPAN it works for me 100% :)
You can 'activate it' like:
which spawns off a subshell with local::lib enabled on your existing perl. You can verify by:
and you will see that 'mylocallib' is added to @INC. It will also add $HOME/mylocallib/bin to your $PATH. When you are done just 'exit' the shell. This way you can have as many local::lib's set up in your home directory as you have projects.
Since it installs cpanminus for you (into the local::lib) you can install a dependency quite easily:
I find this is awesome for installing project dependencies. You simple create your Makefile.PL and then do:
cpanm --installdeps .
and all the listed required dependencies from your Makefile.PL will get installed into your local::lib
I imagine at some point all the features of my little script will be subsumed by larger projects, such as cpanminus or Module::Install::Bundle::LocalLib ,but right now I still find it useful. Using it as above means you can try it without needed to download and setup anything. If you give it a roll and have trouble please let me know.