Showing posts with label CPAN. Show all posts
Showing posts with label CPAN. Show all posts

Wednesday, December 4, 2013

AIX moans: "Cannot open or remove a file containing a running program"


I came across this phenomenon in various contexts on AIX. 
It really sounds like "text file busy" from the old Unix days.

Looks like the guys who misuse this error message for there miserable situations actually mean "cannot open or remove a file". I call this capturing.

Looks like some variants of the "copy" utility (like CPAN File::Copy) use this error message instead of "no such file or directory". Maybe this happens in concurrent environments / situations, where a file disappears between the call to File::Copy and the actual kernel "open". Once "open" has a file handle, the inode access counter gets incremented, and the file cannot really disappear any longer, as long as it remains open ie. did not get closed again.

To be continue …

Tuesday, September 10, 2013

yet another Perl power tool: ack - grep-like text finder

ack - grep-like text finder - metacpan.org - Perl programming language

added "Perl Power Tools" to the PPT "disambiguation page" on the English wikipedia

en.wikipedia.org/wiki/PPT

I am curious, how long this entry will survive there. It's actually not referring to an existing article on the Perl Power Tools. It's just meant to tell "the reader", hey, there are these nice Perl Power Tools out there, and they also get abbreviated as PPT.

Well, yes, I could create a wikipedia stub page, but it would only have these 2 links:

And maybe some short text with like 30 words from the first of these 2 links.

But for how long would this stub article survive on wikipedia?

Wednesday, August 21, 2013

reading a growing file in perl


  • How do I read a file which is constantly updating? (Stack Overflow) [link]
  • How can I read from continuously updated file in Perl? (Stack Overflow) [link]
Approaches:
  • File::Tail (or one of its sisters) is your friend (preferred!)
  • use this (together with sleep(...)) for getting EOF reset: seek(LOG, 0, 1) (if you must stay with vanilla perl)
Wrote my 1st script making use of File::Tail today, a "main log file" referring to short other log files. Now I read all of them using File::Tail. Looks good and rather versatile.

Tuesday, June 18, 2013

CPAN modules for generating passwords (remember "pwgen"!)


I started digging a little into this, when I faced the challenge to provide a customer with a password generator available on his platform. I myself had used Theodore Ts'o's pwgen for years, so that was my search keyword.
  • Neil Bowers on CPAN modules for generating passwords [link] (looks like THE CONTEMPORARY REPORT on the topic)
  • Neil's favourite: Sawyer X's App::Genpass [link] (it comes with a command line utility)
  • Dominik Schulz's Data::Pwgen [link] (I guess, I found only this one, because it mentioned pwgen

Wednesday, March 27, 2013

a Perl module on CPAN for dealing with ZIP archives: IO::Compress::Zip

IO::Compress::Zip - Write zip files/buffers - metacpan.org

I found code, that makes use of this module. The 1st problem, I had to deal with: the file to be written into the ZIP archive and the ZIP archive both get named using absolute pathnames. That's alright for the ZIP archive, but you usually don't like archive members with absolute pathnames. The manual page describes, which feature deals with this ("FilterName"), and it also gives a nice and short recipe.

Monday, February 25, 2013

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 

Monday, August 13, 2012

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