Thursday, December 20, 2007

Adding to the Repetoire

I have been playing around with Perl for about 1 1/2 to 2 years. The last (almost) 8 months of that time has been actually doing it for a living and not on my own, outside of work. The work experience that I have gained in invaluable, but having a job as a Perl developer has also allowed me to delve much farther into the Perl world than if I hadn't had the job. Heck, even having a job AS a developer was absolutely beneficial to my development as a developer.

In the past 8 months my knowledge of Perl has grown from semi-beginner hobby coder, to, in my very modest opinion, a moderately intermediate Perl developer. I have a solid grounding in the Perl basics as well as insight enough to know how to find out about modules, which ones to use and how to use them.

That isn't all though. Back in May of this year(2007), I joined up on the the scripts development forum and only after 3 months on the forum, helping out others and learning all that I could, I was submitted to the membership to become a Moderator. On my birthday I was fully promoted to moderator of the Perl form on the scripts. I have since taken on moderation duties in several other forums (about 9 forums in all right now), but maintain Perl as my "home" forum.

As you can see from the above background, I have gotten myself to a slightly comfortable place in my Perl career. Not at all to a point where I will stop learning, but instead, to a point where I feel comfortable enough about my knowledge that I can now take on learning another language.

There was a toss up as to which language to learn next. I was trying to decide between Ruby, which is extremely popular, Python, again, extremely popular and from what I had heard and read, easy to learn, and something like C#. I know, why C#, its a Micro$oft language? Well, it may be, but you can code C# with the Mono project on Linux and its somewhat interesting.

I thought about it for a little while, trying to decide. C# was actually ousted from the lineup first. I had done some VB at one point and even touched some Java in one of my college courses and I wasn't all that plussed by it. So, that truly helped me make that decision.

Ruby is a very interesting programming language itself. It was touted as powerful and quite popular. Plus, the added benefit of Rails for making web development with Ruby much quicker.

Well, I had to decide, so I chose Python. I didn't have an overwhelming reason why, its just that it appealed, almost called, to me. I liked that everyone said it was pretty easy to learn and the user base was growning steadily. Besides, that would leave me with Ruby as the next one to learn.

So, for almost a week now I have been trudging along at a steady pace through one of my Python books, learning the basic ins and outs. So far, they were right, it is easy to pick up, but I am not going to count my chickens yet. I will give myself some time to get a lot more into the language, but I am quite confident that I will have a similar love for Python that I do for Perl. If that is the case, then I will be a doubly happy person.

Thursday, December 06, 2007

Miscellaneous Updates

I think it best to start with an update of how things are going with my new find (see last post).  Strawberry Perl has been running FINE now for almost a month.  I have installed a bunch of different modules and have run a lot of scripts using it and it is running flawlessly so far.


That, was a lead in to my next update.  I have a web site which I have paid a membership to so that I can access their information.  The web site provides PDF documents (A LOT of them) that contain stamp albums that are created by the site owner.  I am a philatelist and to not have to spend, literally, thousands of dollars on stamp albums makes a collector a very happy person. 


Well, I said there were a lot of files and I was not kidding.  There are a little over 200 countries in the world and each country is split up into multiple pdf files, each containing sections of the full album (this is done for a reason).  To be exact, there are 2,137 files. 


Now, wanting to get the most of my $20 (yes, its pretty cheap), I figured that instead of trying to download ALL of the files by hand that I would try and write a perl script that would do the job for me.  So, that is just what I did.  I was reading up on the different modules that I could use and I decided upon the WWW::Mechanize module written by Andy Lester.


It took me about 2 days to get the script coded, working and tested.  The O'Reilly book "Spidering Hacks" definitely lead me down the right path with their hack(s) on WWW::Mechanize.   I have to credit the author for the examples as I used some of his code in the script as well.  After working out the typo's and little mistakes, plus, since I had never used this module, I had to figure out how to do the Authentication that was required in order to download files. 


I did some searching around the internet and found a link to a page that has a couple of examples of how to do authentication, with one of the examples using WWW::Mechanize.  This was PERFECT.  It worked like a charm and before I could smile I was downloading all 2137 files from the site. 


I must say, perl is a very complex and at times, complicated language but if it there is one thing I can say, it is that I LOVE PERL!!!! 

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.