Perl is designed for doing something quickly without the trouble of writing it in C (and when you need more power than a shell script can handle). It allows you to get something working quickly, so you get instant gratification.

Perl is forgiving of sloppy syntax (but can be strict if you want) and lets you do things a number of ways and get the same results.

It CAN make it easier to learn bad habits that you may have to unlearn later when you get to a more structured language.

Python has many of the advantages of Perl, but not all the disadvantages. Unfortunately no matter how I try, Python just doesn't make sense to me.

I'm not gonna try to start a Python vs. Perl flame war. I've used both, and I do prefer Python, but that aside, both languages are good gateways to C/C++ and other "harder" languages.

Perl, it's true, has a reputation for write-only code. However, there is well-written perl code out there as well. It depends on the programmer using the tool, like with anything.

Python tends, IMHO, to have a cleaner syntax, although the enforced indenting drives some people up the wall, as does the "this" pointer being required in member function declarations. I think these are minor annoyances, but it's your call.

Here's a few good resources for both languages. For Perl, check out Beginning Perl. It's a very good free book on the language. Alternatively, for Python you can check out Dive Into Python. It should also be available in the Debian repos.

Vultaire wrote:Here's a few good resources for both languages. For Perl, check out Beginning Perl. It's a very good free book on the language. Alternatively, for Python you can check out Dive Into Python. It should also be available in the Debian repos.

KOTAPAKA wrote:I am going to uni in October to do and engineering degree and I have the whole summer now. So I was thinking of learning a new programming language. I don't know what language to learn though. I have some suggestions but they might be completely inadequate. Here they go:CPerlLispPythonFORTRAN

As far as I know FORTRAN is used in computational programming. I don't know much about the others. I tried reading wikipedia but it explains it with terms I don't know. Anyway, I need to make an important decision. I have approximately 3 months with perhaps several hours a day. I will most likely learn several of those but I don't want to learn something which is not used anymore. I also want to do this so that I will be able to write scripts and understand Linux/Unix configuration files better.

PS please feel free to add any other language you think is more appropriate than the ones listed above. As I said I am completely new to programming.

Which engineering are you doing?

If it is Comp Sc/EE then you must learn C and perhaps C++. However do remember that it can take you years to master C++.

If it is Aero/Mech/Civil/Physics and if you expect to do heavy numerical computing (CFD/Solid mechanics etc.) then you should learn Fortran (not FORTRAN). Fortran 90/95/03 has matlab like syntax and modern compilers can often auto parallelize good parts of the code.

Python/Ruby are very nice scripting languages but I would suggest that you learn them only after you've done C/C++/Fortran (as they are easy to learn and you can be productive fairly quickly)

One thing I would suggest is that you stick to one language for the first few months and only then move on to others (if needed). Looking at 5 different languages at the same time will only lead to confusion/frustration.

Vultaire wrote:Here's a few good resources for both languages. For Perl, check out Beginning Perl. It's a very good free book on the language. Alternatively, for Python you can check out Dive Into Python. It should also be available in the Debian repos.

I never got a grasp on Perl (even after reading "Learning Perl," the O'Reilly book) until I worked through a tutorial called "Robert's Perl Tutorial." The Google will find it. The original is long gone, but it's mirrored many places. Short, humorous and easy to follow.

For Python, there's a book called "How to Think Like a Computer Scientist" that is designed to teach beginning programming using Python. I've heard it is excellent. It can be found here: http://www.openbookproject.net/pybiblio/books/

Gomer_X wrote:I never got a grasp on Perl (even after reading "Learning Perl," the O'Reilly book) until I worked through a tutorial called "Robert's Perl Tutorial."

Fair enough, but I would be reluctant to recommend a tutorial where "the last hack was made on 20th April 1999." Perl has changed a lot since then. That said, the Google did find it (in many places), and here it is.

"We have not been faced with the need to satisfy someone else's requirements, and for this freedom we are grateful."Dennis Ritchie and Ken Thompson, The UNIX Time-Sharing System

Telemachus wrote:Fair enough, but I would be reluctant to recommend a tutorial where "the last hack was made on 20th April 1999." Perl has changed a lot since then. That said, the Google did find it (in many places), and here it is.

It's not a complete text on learning Perl, it's just a short tutorial. I didn't find anything in it out of date. It's definitely incomplete, but it got me hooked enough to move on to more in depth references.

If you want the works, get the latest Camel book (although that's outdated with Perl 5.10 out [edit: it was actually printed in 2000 and current as of Perl 5.6]).