Showing posts with label App::perlbrew. Show all posts
Showing posts with label App::perlbrew. Show all posts

Sunday, October 7, 2012

brewing perls on my platforms

[2012-10-07 12:45:26] johayek@HayekY $ cpanm --force WWW::Curl

[2012-10-07 03:17:01] johayek@HayekY $ perlbrew --force --notest install perl-5.16.1

[2012-10-07 12:47:56] johayek@HayekU $ perlbrew --force --notest install perl-5.16.1

Saturday, September 8, 2012

openSUSE-12.2 : upgrading again …

  • downloading the 4.7GB DVD ISO image from a mirror – funny to watch a download rate of 1.92M/s with wget; my last installation was with the network CD, but this time I am giving the DVD installation another try, as I want to implement this upgrade on 3 boxes within a rather short time after the release of 12.2, so there should only be a few upgrades necessary and most packages will get installed from the DVD anyway
  • checking the download: sha1sum openSUSE-12.2-DVD-i586.iso
  • cutting the DVD – doing this on my Mac using Disk Utility – OS X refused to mount the DVD afterwards; but the PC booted from it (etc.) w/o complaints
  • installing 12.2 on the Eee Box
  • rcxdm failed; I removed /etc/X11/xorg.conf, after that I am able to start up rcxdm successfully; apparently /etc/X11/xorg.conf.install is also quite suitable /etc/X11/xorg.conf – it uses the screen with 1024x768 at least
  • logging into the system with ssh works as usual for root but not for my personal account – solved! they changed something in sshd_config, from now on only .ssh/authorized_keys counts
  • installing 12.2 on the NEO
  • installing 12.2 on the ASUS notebook
  • installing 12.2 on a "x86_64-suse-linux" VirtualBox VM with Mac OS X as host
  • [now] …
Of course I need these, and of course I have notes on them here on the blog:
  • $ zypper install gcc
  • $ zypper install patch
  • $ zypper install libcurl-devel
  • perl: $ perlbrew available # perl-5.16.1 (needed "--force --notest"), perl-5.14.3-RC1 (???), perl-5.14.2 (broken on my x86_64-suse-linux), … – it does not list all available ones, only the most recent ones on all major releases – here are all of them: www.cpan.org/src/5.0/ – you may want to pre-download a few of them ("$ perlbrew download perl-5.14.1"), and they go here: $PERLBREW_ROOT/dists/
  • perl: $ perlbrew install-cpanm; perlbrew install-patchperl
  • perl: migrate CPAN modules using perlbrew and cpanm (https://metacpan.org/module/perlbrew)
  • ruby: rvm

Friday, August 31, 2012

how to transfer all modules from one perlbrew environment to another?

I mean something like rvm's migrate resp. upgrade.
Looks like list-modules helps me there.

I had to upgrade somehow, but the published path didn't work for me. After I removed $HOME/.perlbrew and I did a fresh installation, I was successfully upgraded.
Now this runs smoothly:
$ perlbrew list-modules
Right now I am running a
$ perlbrew upgrade-perl # upgrading to 5.16.1
And I hope, even this will run smoothly afterwards:
$ perlbrew list-modules | perlbrew exec --with perl-5.16.1 cpanm 
It said:

Upgrading perl-5.16.0 to 5.16.1
Fetching perl-5.16.1 as /usr/local/perlbrew/dists/perl-5.16.1.tar.bz2
Installing /usr/local/perlbrew/build/perl-5.16.1 into /usr/local/perlbrew/perls/perl-5.16.0

Installing 5.16.1 broke today. Alright, I will try something else:
$ perlbrew list-modules | perlbrew exec --with perl-5.14.2 cpanm

I had a few messages like this one:
! Finding HTML-TableExtract on cpanmetadb failed.
Installing manually with cpanm replacing "-" by "::" worked anyway, eg. HTML::TableExtract instead of HTML-TableExtract.

==========


I will try installing ("upgrade-perl") 5.16.1 again sooner or later …

I wonder, what this will say afterwards:
$ perlbrew list
Will it list 5.16.0 and also 5.16.1?

I like my "stable" alias:
$ perlbrew alias create perl-5.16.1 stable 

Wednesday, August 1, 2012

developing software in Perl – I really like it with cpanm and perlbrew

  • my own updated notes on App::perlbrew [Link]; including a note on creating a stable alias for steady and ongoing use
  • my own notes on App::cpanminus, "yet another CPAN installer" [Link]
(Just for me, for finding my way through confusion.)

My usual starting point before installing a CPAN module:
$ perlbrew switch stable

Monday, February 21, 2011

RVM: Ruby Version Manager

http://rvm.io (!!! worth having a look there for the most up-to-date installation procedure !!!)

Allows you to work very well with more than one ruby installation, just like App::perlbrew for perl.

The rvm command is implemented through a lot of bash functions.

The PragProg ruby3 and the jruby book both talk about rvm, and it looks, as if rvm is really quite helpful, if  you deal with more than one ruby interpreter.

I installed rvm locally on an openSUSE-11.3 system and also remotely (git-based), and also on Mac OS X 10.6.6 (not git-based (yet)).

Update 2011-02-22:
Output from my $HOME/.bashrc disturbed the smooth execution of rvm, I had to remove that output (although I really liked that).

Update 2011-07-15 – how to upgrade:
$ rvm get stable
$ rvm reload
$ rvm list known
$ rvm list
$ rvm install jruby-1.6.99999
$ rvm install ruby-1.9.99999
rvm all do gem install xml-simple
$ …


Update 2012-01-… – trouble with "get head"!!!
$ rvm get head # looks broken, avoid it for the time being!
This really caused me a lot of grief and fear.

$ rvm get stable # better for me

Update 2013-09-30
(Nowadays) before running rvm, you need to run some initialisation code:
source $HOME/.rvm/scripts/rvm

Friday, December 10, 2010

CAM::PDF - PDF manipulation library by "Clotho Advanced Media"

CAM::PDF - search.cpan.org

I am currently into PDF "reading", and this software looks rather promising.

There are also a couple of nice command line utilities in the TAR ball's bin/ subdirectory.
  • appendpdf.pl
  • asciify
  • changepagestring.pl
  • changepdfstring.pl
  • changerefkeys.pl
  • crunchjpg_tmpl.pdf
  • crunchjpgs.pl
  • deillustrate.pl
  • deletepdfpage.pl
  • extractallimages.pl
  • extractjpgs.pl
  • fillpdffields.pl
  • getpdffontobject.pl
  • getpdfpage.pl
  • getpdfpageobject.pl
  • getpdftext.pl
  • listfonts.pl
  • listimages.pl
  • listpdffields.pl – sic!!! – I adapted that a little, now it shows page num. (with a little extra help from Chris Dolan) and the position for each field
  • pdfinfo.pl
  • readpdf.pl – shows you the PDF data structure as perl data dump
  • renderpdf.pl
  • replacepdfobj.pl
  • revertpdf.pl
  • rewritepdf.pl
  • setpdfbackground.pl
  • setpdfpage.pl
  • stamppdf.pl
  • uninlinepdfimages.pl
Of course, they all use /usr/bin/perl and not /usr/local/perlbrew/bin/perl, and I am currently still into perlbrew., so how would I replace all these occurrences?
That reminded me of that fixin utility from the very old days, which updates the #! ("shebang") line appropriately.

App::perlbrew : the man page and "perlbrew list"

The man page makes you think, there is a "perlbrew list", and older versions didn't have it. Older versions had a "perlbrew installed" instead. Quite a good reason to upgrade you perlbrew.

Thursday, July 8, 2010

App::cpanminus – a new CPAN installer

How to …:
$ perlbrew switch stable # resp.
$ perlbrew switch perl-5.12.1
$ cpan  App::cpanminus
$ cpanm App::cpanminus 

$ perlbrew install-cpanm # remove the previous suggestions?


$ perlbrew switch perl-5.10.1
$ cpan  App::cpanminus
$ cpanm App::cpanminus

$ perlbrew install-cpanm # remove the previous suggestions?

To be continued ...

Friday, July 2, 2010

App::perlbrew - Manage perl installations in your $HOME or wherever you want

Prerequisites:
  • $ zypper install patch
  • $ zypper install gcc
Caveat:
  • yes, "perlbrew install" occasionally and too often  needs "--force" and even "--notest", don't be too surprised! my "5.14.2" and also my "5.16.1" needed it

Main links:

$ export PERLBREW_ROOT=/opt/perlbrew
$ curl -kL http://install.perlbrew.pl | bash
# or maybe like this:
$ perlbrew self-upgrade


The developer/maintainer does not have in mind this use case as the main use case!! But it is my main use case.
What to do after installing a new perl, that you consider your new stable perl?
$ perlbrew alias create perl-RELEASE stable 
# resp.
$ perlbrew alias -f create perl-RELEASE stable
# use this shebang line with $PERLBREW_ROOT expanded [Link]:
#! $PERLBREW_ROOT/perls/stable/bin/perl

$ perlbrew switch stable # this will be our usual starting point!!!
 
# but "perlbrew list-modules" does not work on such an alias, so "perlbrew use" to a non-alias before!


  • Have a serious look at "$ perlbrew help" once in a while!!!



I decided to make use of $PERLBREW_ROOT, as I want to keep my home $HOME minimial, just data and scripts, no big files, they all go to other disks. And right, my home directory is on an encrypted partition, and this sort of stuff certainly does not get encrypted.
$ export PERLBREW_ROOT=/usr/local/perlbrew
Therefore my perlbrew is installed as:
/usr/local/perlbrew/bin/perlbrew
They suggest, that my $HOME/.bashrc should "source" their .../etc/bashrc, but for the time being I let my $HOME/.profile do this, as IMHO this is right place.
So actually this is according to best practices for shell programming the right way (for me) to do it, and now this code is of course included in my $HOME/.profile:


# for perl's App::perlbrew :
export          PERLBREW_ROOT=/usr/local/perlbrew # on my Linux boxes
export          PERLBREW_ROOT=/sw/perlbrew # on my Mac box(es)
source         $PERLBREW_ROOT/etc/bashrc
##export  PATH=$PERLBREW_ROOT/bin:$PERLBREW_ROOT/perls/current/bin:${PATH}
path_prepend   $PERLBREW_ROOT
path_prepend   $PERLBREW_ROOT/perls/current


BTW: always "$ hash -r" after switching, so you avoid getting certain perl resp. perlbrew related error messages like this one and a few others (confusion of the right installation directory):
bash: …: No such file or directory
I successfully brewed 5.10.1 and 5.12.1 on openSUSE-11.2, but on OS X Snow Leopard I only brewed 5.12.1 successfully, brewing 5.10.1 failed.


To be continued …


Update 2011-10-16:
On my Mac running Lion I was able to perlbrew these releases of perl


  • perl-5.15.3 and
  • perl-5.14.2
  • but not perl-5.12.4, 5.10.1, 5.8.9, 5.6.2

but that seems more than sufficient to me.

Looks like OS X got targeted as a serious platform for perl development only rather recently.


Update 2012-10-07: A historic note: I first looked into perlbrew in the context of "biz-JG".