Blog of Leonid Mamchenkov

You just stepped in a pile of posts.

Entries Tagged as 'Perl'

Perl modules of the day

Posted in All on December 8th, 2005 · No Comments

I’ve been doing a whole lot of Perl recently. Because of that, I spent a lot of time at CPAN. As a result, I came across a few excellent modules that I didn’t know about before. Here is a round-up for you:

  • Devel::ebug - Perl debugger, than can be used from the web and from the scripts.
  • Class::DBI::Sweet - some really useful stuff for Class::DBI users.
  • DBIx::Class::CDBICompat - compatibility layer between Class::DBI and DBIx::Class. In case I’ll ever move to DBIx::Class.

Also I have to express my amazement with XML::RSS, which goes far beyond RSS documents and parses almost any XML document. Outstanding job!

→ No CommentsTags: , , ,

Missing some regexp knowledge

Posted in All on October 26th, 2005 · 2 Comments

Once in a while I come across some topic that I should have learned a billion years ago. Something very basic and useful that I had a chance of seeing many times but haven’t, or probably had and ignored it. Today I found out that I was missing an important bit of Perl regexp knowledge. And you will probably laugh in my face when I’ll tell you.

[Read more →]

→ 2 CommentsTags: ,

Perl vs. Java vs. any other programming language

Posted in All on October 26th, 2005 · No Comments

Ovid once again does an excellent job. This time he talks about choosing proper tools for the job, using computer programming languages as examples.

Do not choose solutions if you don’t know what the problem is.

→ No CommentsTags: , , ,

Synchronizing directories with Perl and SSH

Posted in All on October 20th, 2005 · 2 Comments

For a while now I have been using ICQ both at home and at work. Instead of having two different copies of data or running ICQ remotely, I was simply copying all data files over between these two locations. rsync with scp were doing the job just fine. The problem emerged when I started to use ICQ on more than two machines (two machines in the office and one at home). I had to always figure out where is the latest copy of my data and distribute it from there to all the other locations. After doing it manually for just a couple of time bored me to death and I decided to write a script.

I started off with a very specific script that was only meant to copy my ICQ back and forth, but quickly realized that it can be generalized to copy any set of directories. So, here it is - sync_dirs.pl.

This script accepts and requires only one parameter - directory to synchronize. You can define a few shortcuts for frequently used directories inside the script. Locations are also defined inside the script. Since this piece of code uses Net::SSH and Net::SCP, the current limitation is that you must have ssh configured to authorize with keys, not passwords. The good news, is that you need only one location to be able to access all the others. The most recent copy of data will be copied over to this central location and from there distributed to all the other machines.

→ 2 CommentsTags: , , ,

Generating ultimate movie wishlist with Perl and IMDB

Posted in All on October 19th, 2005 · 4 Comments

One of the things that will go into history with the year 2005 is the number of bad movies produced by Hollywood. IMDB says:

Hollywood is mired in its biggest box-office slump in over 20 years.

With all those bad movies around, finding something worth the time and effort becomes increasing difficult. Luckily, there are these two things that can make our lives easier - IMDB and Perl.

Combining the two all sorts of interesting things can be achieved. Particularly, an ultimate movie wishlist can be generated.

If you are here just for the script, than here is the movie_wishlist.pl. If you want just the result, than here is wishlist.html. Otherwise read on for the explanations on how it works and how you can make it better.

[Read more →]

→ 4 CommentsTags: , , , , ,