Perl

rpm, yum and broken perl installation

My Fedora Core 7 box recently ended up in some state where my perl installation was seriously messed up. I'd get errors about mismatch in platform architecture, problems with sockets etc. etc. So, I really wanted to have yum reinstall all my perl packages. I couldn't find a way to do that, but I managed to achieve something similar using various commands. Here are the steps I followed:

# rpm -qa --qf '%{NAME}\n' | grep '^perl-' > /tmp/perl.pkgs
# rpm -e --justdb --nodeps perl `cat /tmp/perl.pkgs`
# mv /usr/lib/perl5 /usr/lib/perl5-
# yum install perl `cat /tmp/perl.pkgs`

PLEASE! Be careful with these commands, make sure you know what you're doing, check the /tmp/perl.pkgs file to make sure it seems reasonable etc. Once this is all done and finished, I removed the old perl5 library (perl5-).

As an alternative, you could also do something like

# rpm -q --qf '%{NAME}\n' --whatrequires perl > /tmp/perl.pkgs

but that will reinstall more packages than absolutely necessary, I think.

Adobe socket policy file server

I was recently talking to a friend of mine, that had to go through all sorts of hoops setting up a socket policy file server for his Adobe Flash content. This is a weird beast, which does not use HTTP for some unknown reason. Adobe provides some very simple server examples, which they say are not "production quality", and I'd have to say I agree. So, I whipped up a simple Perl server using the POE framework, and with a little help from Rocco, I think it's a pretty decent implementation. It doesn't do any logging or anything fancy like that, but if anyone is interested, I could certainly add that (or anything else that might be useful). The little perl script can be found here ftp://ftp.ogre.com/pub/leif/perl/policy_server.pl .

For more information on this new "protocol", see http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html . There are several example implementations there, as well as full explanation on how and why the policy files are important.

Feedback and comments is welcome.

Retro hack: box.pl

Way back when, I grew up on a PDP-11 running BSD-2.9, using VT100 terminals. This was such a joy to use compared to the DEC-20's running TOPS-20. On this system, there was this little tool called "box", that to my astonishment, would draw a very nice looking box around arbitrary text. I obviously put this into my .login file, pipe'ing fortune through it.

I could never find this tool on any "modern" Unix (Linux) systems, so I decided last night to write one in perl. Attached below is the end result, Enjoy!

http://www.ogre.com/files/ogre.com/box.png