Python or Perl

eakers

Lifer
Aug 14, 2000
12,169
2
0
I need to write a short, easy script that will involve a lot of regular expression work. I have kind of narrowed down to python or perl but I am not sure which to learn. I don't necessarily want to pick whatever is easier but rather which one will be the most useful down the road.

I have been all over the internet looking at what might be useful and I think I am wading into one religious issue after another. I am thinking of just taking the weekend and learning both and then deciding which I like better unless someone can give me some good reasons why I should pick one over the other.

Some background that might be helpful: C++ is my main programming language although I dabble in .NET and web programming of all kinds (PHP, ASP, ASP.NET etc).
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Like you've said it doesn't matter which one you choose, both are plenty powerful for what you want to do. I would perhaps try a few small programs first and see which language is easier for you. I personally like Perl over Python for regular expression work :)
 

QED

Diamond Member
Dec 16, 2005
3,428
3
0
If you're familiar with PHP, Perl will be a breeze.

Plus, Perl is amazingly useful for all sorts of small (and large) odd jobs-- it's the duct tape of the programming world.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Originally posted by: QED
If you're familiar with PHP, Perl will be a breeze.

Plus, Perl is amazingly useful for all sorts of small (and large) odd jobs-- it's the double sided duct tape of the programming world.

fixed ;)
 

eakers

Lifer
Aug 14, 2000
12,169
2
0
Thanks for the replies, after looking at some small tutorials I decided to go with Perl because of how similar it is to php (and the recommendations of this thread ;)). So far it has been a piece of cake to pick up but I am not doing anything difficult. Would you guys recommend getting a book to get into some of the more advanced topics or just stick with poking around the Internet? While I don't necessarily have a use for more advanced stuff right now, I'd like to know whats available.

Also, is it a good idea to venture down the path of object oriented Perl?
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
The O'Reily books are good for Perl, they even have one on Regular Expressions too(i think).
 

esun

Platinum Member
Nov 12, 2001
2,214
0
0
There are two iconic references that every true Perl hacker has read. They are the llama book and the camel book (as known by the animals on their covers).

The llama book is "Learning Perl", and is the book for actually learning Perl (as you can imagine).

The camel book is "Programming Perl", and is the more advanced reference written by Larry Wall (creator of Perl).