登録情報
|
この商品にタグをつける(詳細)タグは、商品との関連性が非常に強いキーワードまたはラベルのようなものです。
タグにより、すべてのお客様がお気に入りの商品の整理と確認を行うことができます。 ※タグは初期設定で公開になっています。詳しくはこちら |
また,他の本では何故か説明されないような皆持つ疑問を章末にて質疑応答形式で答えている.
I consider myself to be beyond the novice stage in Perl programming, but far from an expert, so I was very interested in what Perl: A Beginner's Guide had to say.
It is a maddening book. I really would like to say something positive about it, but it is so full of typos, and so haphazardly put together, that I just can't.
The slipshod feeling shows right from the beginning. After explaining how to run the traditional "Hello, World" program, the authors explain the chomp() function, which removes a newline character from the end of an input line. We're then given a Note, with a box around it, to clear up a key point:
"Perl also has a function called chomp(), which removes the last character of a string. Unlike chomp(), chomp() removes any character, no matter what it is, whereas chomp() only remove the character if it's a newline character. When you only need to remove a trailing newline character, you should always use chomp(), because it's safer."
Got that?
Sure, you know that they're talking about chop() versus chomp(), and this is only a typo. But how long will it take the beginner who's reading this book to figure that out?
On page 59 the authors introduce Perl's comparison operators, including the = = operator inherited from C, and the source of much confusion among novices and experts alike. Twenty-three pages later we finally get an example of one of these operators, and it's wrong:
$a = 20;
if( $a = 15){
print "a is equal to 15\n";
}
else....
This example, of course, will print "a is equal to 15" until the cows come home. Or until the reader throws the book aside in disgust.
I could go on, but you get the point. The problem is not only that the book is full of small errors like the ones I've cited; the problem is that their presence makes you mistrust everything the book says, even when it's correct.
A more subtle issue, and one that's harder to get a handle on, is the fact that the book's examples are, for the most part, trivial. You get the feeling that the authors, faced with the need to come up with an example to illustrate the feature of the language they were discussing at the moment, just wrote down whatever popped into their heads. The examples illustrate the point, but they don't take on the more important job of helping the reader to begin to think like a Perl programmer.
For example, in the section on regular expressions, there are a series of examples that use this syntax:
if ($result = $string1 =~ /Hello/){
This example is used over and over, and yes, it works. But, since we never make use of $result anywhere else, a Perl programmer would simplify this to:
if ($string1 =~ /Hello/){
Moreover, in the real world, you'd be more likely to see something like:
if (/Hello/){
-- which makes use of the implied $_ variable. Although an awareness and understanding of the many $x variables are key to understanding Perl's often-cryptic syntax, references to them are sprinkled haphazardly throughout the book; nowhere are they laid out in a logical, orderly fashion.
As I said at the beginning, I really would like to like this book. The authors obviously have gone out of their way to try to write a manual that makes Perl approachable for beginners. What they've got here is a good first draft; but it's not ready for publication.
The book starts off with a brief history of Perl and then slowly introduces the language of Perl a step at a time. Then it goes to the next logical step without skipping over important topics. The book does a good job of helping the reader write Perl programs for the three major systems NT, Unix and Mac and even gives some advice on how to work your server settings and how to access Perl with html.
One of the areas the book could improve on is how you can apply the lesson you are learning about Perl for a problem. While the book does cover this a little bit, and anyone with some programming knowledge knows why or how, the authors could give a few real world reasons why you need such things as arrays in Perl.
This book is highly recommended. Reading through this book will give you an excellent base in learning the Perl language.
bad: the book is ATROCIOUSLY edited. i find at least one significantly confusing typo every few pages. if you look on the bright side, you can use these mistakes to hone your skills on finding scripting errors, but in general, it seems to reflect a lack of care in putting the book together.
ugly: this is for an absolute beginner who's willing to work through all of the typos. you will have to shell out additional $$ to begin to use perl in any productive manner.
|