Home > Archive > Certified Internet Webmaster - CIW > May 2001 > I HATE PERL ! - but I passed......





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author I HATE PERL ! - but I passed......
Mike Ross

2001-05-08, 12:12 am

I must say that during the class we found many complaints about the courseware for Perl. As an example, they go through a chapter, or a section of it, then tell you to write a script that does whatever...
You wrack your brain for awhile and, realizing that they haven't really shown an example of what they are asking you to do, you take a look at the completed exercise. You find that they have used some method of coding that they have shown no example of, and at best have barely even mentioned.

As for the test... I was really surprised at how long it took me to finish. I did the JavaScript test in less than half the time allotted. But the Perl test had a whole load of questions that required you to figure the output of a script. They seemed to use some coding methods that were never even mentioned in the book. I strongly suggest looking very closely at ALL of the completed exercises, just to see what kind of oddball coding they do that they have neglected to tell you about. If you look at all of their scripts, and figure the outcome on your own, you will probably run into some of the stuff they'll throw at you on the test.

Here's one that had me perplexed. I haven't even looked at the book since the test, so I'm not even sure if I got it right (in fact, I'm not even sure if I remember which answer I selected). Anyway, here it is as near as I remember:

#They give you a script that starts with a print statement
print("= " . add(2,3,5,7) . " ");

#Then they have the script for the subroutine called add. I won't bother to try to remember that part. What it boils down to is that as you do each loop in the subroutine, it prints each of the four numbers passed to it by the print statement. It also adds each number to the variable $total during each loop. $total came out to 13 (so, it obviously wasn't the exact numbers I put above, but you get the idea). We'll say that $total is 17, OK?
Now, somwhere in the subroutine it must have also printed a + sign with each number, so you'd get a string like "2+3+5+7" after all the loops are done. Now, the answers were along the line of:
17= 2+3+5+7
2+3+5+7= 17
= 2+3+5+717

Now, I think that I selected "2+3+5+7= 17", using the rationale that the print statements in the subroutine are going to print first, and then the "= " and then the 17 that is returned to the print statement by the subroutine. Seems reasonable.... I think that's the answer I selected.....
But, I recall that I was perplexed while trying to decide whether it was going to print in the order of "= " , then go through the subroutine and print the "2+3+5+7" in the loops, then print the "17" after the subroutine returns it to the print statement, and then print the " " at the end of the print statement.
If the subroutine is run before any part of the print statement is actually printed, then "2+3+5+7 =17" is the right answer.

OK, so there you have it... look in the book and determine what would happen in this type of scenario, and you'll know as soon as (if) you see this question. I know it's only one question, but I spent quite awhile wracking my brain, and wondering if these guys were trying to trick us with an answer that didn't make sense (like "= 2+3+5+717"). I wouldn't put it past them. So, if you run into this question and know what to do right away, it will give you more time for the rest of the questions.

Be prepared with your scratchpaper, there were several that I had to write down every change to a variable, and the output of every print statement.

As a kind of benchmark, I got a 92 on JavaScript and only got 82 on Perl. Actually, I should've had an 84, but as I hurriedly reviewed the questions with only seconds remaining, I saw a question that I thought I had put the wrong answer on (a question near the end of the test made me second-guess this earlier answer). I quickly switched the answer. As I did so, I was scanning the question. I don't think the onClick event had finished when I realized that the question wasn't asking the same thing as the later question had, and that my original answer was right. No sooner had that thought fought its way through my now gelatinized gray matter, than the screen blanked out, and a nasty little prompt box appeared.... "Time's Up".
I don't know if that monitor realizes how close it came to an early retirement....
OK, enough excuses already !!!!
The question in question (hmmm) initialized an array. Something like:
@array = (0,1,3,5,7,9..16);
Then it asks how many elements are in the array. Now, I'm thinking that the range 9..16 assigns each number in that array to an element... er, right? If that's the case, then the array has 13 elements.
The question later in the exam did the same type of thing declaring the array, but then it asked what the output of print($#array); would be. So, I see how many elements there are in the array, and look for that number in the answers. Luckily, that number wasn't there, or I would've picked it. Since the number one less than that number (which would correspond to the number of the last element) was there, I deduced that $#array gives you the last element number (which would be one less than the number of elements). So, I picked the right answer, and thought that I had to go back and change the earlier answer.... but I didn't. Well, maybe this little lesson will help someone.... don't change an answer until you've re-read the question !

So, the moral of the story is... the Perl test and courseware really really suck compared to the Javascript, and the Foundations. Let's hope that this is just a fluke. My theory is that the only guys that they could find that were still the least bit interested in Perl were your stereotypical anti-social computer geeks from the old days, trying to prove that "they know more about Perl than you do"... ever run into that type? Of course you have.
Hopefully the rest of the books were written by people that know how to write educational material (I really thought the JavaScript courseware was good). At the very least, it shouldn't take much for the subject matter to be more interesting than Perl.... did I mention that I hate Perl? I think I'll go buy one of the Sam's "Teach youself Perl in 24 hours" books, just to see if there are any redeeming qualities in it.

OK, enough of me already !!

Good Luck to the rest of you.

I'll keep you updated if I think anything else sucks....

Hasta la Pasta,

Mike
SasiSan

2001-05-08, 8:11 pm

Wow! That was a lot of information.

First -- CONGRATULATIONS!!!

Second -- Thanks for all the info. I won't comment especially since I don't know Perl yet. I will say this though. You said it was a 'class' which means an instructor. The reason you pay the extra for that person is so that they will answer your questions and save you from confustion!

Third -- Casey can comment on the book. That is definately his area.

Lastly -- What's next???

Good luck!
Mike Ross

2001-05-09, 2:23 am

Thanks....

Yeah, unfortunately, the instructor isn't there to save you from confusion when you take the test. Whoever wrote the courseware and the test did a really screwy job of it. I mean, I ran into coding methods that were never even mentioned in the book.
As an example (I'll keep this short), they mention qw{} very briefly. They just say that it "treats the words inside the brackets like a list". Wow, very detailed explanation! And the example they show of its use is,
DBI qw{:all};
No further explanation, just that.
Then in the test, they use it in this context:
@array = qw(alpha beta gamma delta);
print(join(":", @array));

Now, the join part is easy, but you basically have to assume that using qw() in this manner is going to properly populate an array. In essence, you have to infer that qw() is going to place quotes around each word, and commas in between. This is, in fact, the case, but they never mention this in the book. I don't even know if I chose the right answer. Talk about confusion!

For this test I strongly suggest getting additional study material. It'd be hard to do any worse than the CIW book on Perl. Also, as I said in the last post, read through ALL of the completed scripts from the CIW Perl CD. I'm sure some of the coding conventions that they use in the test will be found in those scripts, even though they may not be mentioned in the book.

On a brighter note, we started on PHP today, and this book seems to be written in a far more competent manner... let's hope this trend continues through the rest of the courses.

See Ya,
Mike
BootData

2001-05-09, 3:46 am

congrats!

btw, could you recommend good books on Perl and PHP? i'm TOTALLY new on Perl and PHP

thanks...
SasiSan

2001-05-09, 7:16 pm

What is the difference in the flavors of Perl... Like BootData, I am totally new to Perl!

???
Mike Ross

2001-05-11, 7:15 pm

Well, BootData, I haven't read any other books on Perl yet, but my instructor swears by the Sam's "Teach Yourself (Whatever) in 24 Hours" line of books. I've also read those books for other things, and I like them. I'd recommend trying that.

In reply to SasiSan's question about "flavors of Perl"... there's just one... but PHP has alot of similarities, especially the pattern matching statements, or what they call "regular expressions".
BootData

2001-05-12, 7:16 pm

hi Mike Ross,
thanks for the input,

i think instead of learning Perl, i'd do ASP and PHP instead

cheers
cboyles

2001-05-12, 11:57 pm

You can write ASP's using perlScript you know. I personally create alot of ASP's but I have to say that Perl is my next best friend. Especially when you got to turn out a lean solution that requires the customization of alot of Turnkey solutions.

About Books....You cant Go wrong with the O'Reily books. For Perl on unix THe Llama, and the Camel
For Perl on Win32 the Gecko. THe best documentation for the Active Perl for Win 32 ships with the Active perl install.

Cheers!
Casey
BootData

2001-05-14, 6:43 am

cboyles
SasiSan

2001-05-14, 8:47 pm

Crud... I bought the Lama... Is it so different??? Aren't more Unix users using Perl? I am such a Microsoft baby! Give me VBScript and ASP's.

Oh well, in this too I must grow
Sotet

2001-05-15, 10:37 am

> Crud... I bought the Lama... Is it so >different??? Aren't more Unix users using >Perl? I am such a Microsoft baby! Give me >VBScript and ASP's.

Perl was written for Unix web servers since the early Internet was and is predominately Unix. Perl was supposedly simplified programming compared to what was used earlier, which for me as a non-programmer is hard to imagine!

You can set up a Windows webserver to run Perl, but Perl does work better in a Unix environment.
cboyles

2001-05-17, 1:48 am

Perl is Perl, as far as we are concerned, Unix or Windows, it does the same thing for us on the Web. Crunch Data Streams. IIS runs Perl as well as my Apache Servers run Perl. It isnt the server but the magic of the programmer : > )

Casey
Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net