in reply to Perl What for?

"...yells at you about things that are confusing and uncomprehendable?"

Hi NoobiePerlist. There is indeed a very good reason for that. Because the interpreter does not know what you are trying to do, it only does what you tell it to do. When i first started seriously programming back in 1996 (with C++ no less) i felt the same way. "What the heck does that mean?!?!?!" With C++, there is no interpreter, but instead a compiler. The principle is still the same though ... something reads your program one line at a time and attempts to do something with it. When you tell something to do an instruction it does not understand, that something tries very hard to tell you why it cannot. Unfortunately, until you learn what is really going on under that hood, you will not understand what something is trying to tell you.

Now, fast forward a couple of years. I am taking a compiler course where we have to write our own compiler that will take a language that we design and turn a program written in that language into instructions (called machine code) that makes the computer do stuff. Add numbers, assign values to variables, etc. Suddenly, i have to decide what my compiler will do when it encounters an instruction that it cannot parse. What the heck was the person who wrote this trying to do? I don't know. I will never know. Are you starting to see the light? A compiler (in the case of languages like C++ and the minimal one i wrote) or an interpreter (in the case of languages like Perl) can only do what the person who wrote the program tells it to do. It cannot guess what they are trying to do, and as such, it can only hint at what is wrong. And let me tell, those wacky confusing incomprehensable messages that the compiler/interpreter spits out at you when you do something wrong are really quite wonderful, once you get some experience under your belt.

My best advice to you is the same advice i give to my C++ lab students. First: code in small chunks - don't write an entire program first and then try to debug the entire thing. Instead, code a couple of lines and debug those - at least then you will be more likely to guess what really went wrong. Second: when you do have errors, focus on the first one - not the last one. Solve the first one and the others might just go away too.

Also, you can use perldiag to help you decipher some error messages that you will encounter. Good luck, and remember, learning to program does not happen overnight. :)

Oh yeah - regarding this statement:

"...my posts get lost because I can't find them..."

Registered members can always find their posts by going to their home node and clicking on the number next to the Writeups attribute. For example, here are yours . :)

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)