Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ovid (2709)

  (email not shown publicly)
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Saturday December 03, 2005
04:59 PM

"PERL in easy steps"

[ #27845 ]

From their Website:

"PERL in easy steps" instructs the reader how to write Common Gateway Interface (CGI) scripts in the popular Practical Extraction & Reporting Language (PERL). These allow the exchange of data between a web browser and a web server both on Windows platforms and on Unix-based platforms, such as Linux. The book contains exciting chapters on the major features of the PERL language and there are complete example scripts that illustrate each aspect of PERL.

If that doesn't give you an idea of how bad this book is, here are a few choice items from the book which is copyright 2004!

  • "for" is for C-style loops and "foreach" is for iterating over arrays.
  • Slices? They've been renamed "subarrays" (though the word "slice" is correctly used in other parts of the book).
  • Matt's Script Archive is one of the top three recommended PERL (sic) resources.
  • What's "strict"?
  • Who cares if open FH, $file succceeded?
  • Nah! This book includes its own lightweight and buggy form parser.
  • I found no mention of security (that include taint mode).
  • Standard web form counter errors (race condition).
  • Incorrect use of "flock" (race condition).
  • It's real fun reading <a href="http://localhost/cgi-bin/">Click</a>
  • Why are we explaining "pack" to new programmers?

And to really get your blood boiling, from page 84 of my edition:

Like other functions a PERL subroutine can be passed a value as an argument from the caller.

The argument as usual is contained in regular brackets that follow the subroutine name in a function call.

PERL automatically stores the arguments passed in a special array called the "underscore array" - which is addressed as "@_".

The first argument value is placed in the underscore array's first element and can be referenced with the syntax "@_[0]".

Yes, conventional wisdom is correct. PERL (sic) is line noise.

And for creating "library files":

The subroutines in a PERL script may be placed in a separate file called a library. Library files are text files that contain the subroutines and normally have the ".lib" file extension.

Of course, since the author never mentions namespaces, the subroutines in a "Library file" are all in package "main" and you can use them with this handy syntax:


require "subs.lib";


&dochead("Subroutines Library");


Why don't you give the publisher some feedback?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I always cringe and want to shout expletives when I see "PERL" and not "Perl".
  • I have been speechless for minutes, after reading this. This is a post I feel I should reply to, to express how I think about it. But it was too much of a shock. My thought and feelings about this book are extremely hard to describe.

    It's the same kind of feeling I get when I see someone without arms and legs, who is blind and deaf. I really do wonder how the author of this book manages to live with such a huge handicap. Not even the combination of great stupidity and even greater ignorance could stop him fr
  • Warning! Do not download and read the example code from the website! The misuse of HTML 2, let alone the abyssmal Perl code, will burn your eyes out.

    Oh, the horror! Ovid, I curse you for exposing me to this evil. I want my ignorant bliss back.

  • Ah. Deja-vu. This reminds me a lot of the time I spent doing detailed reviews of "Perl and CGI for the World Wide Web" and "CGI 101".

    I left a comment on the book's feedback page and I got a response from the author which pretty much missed all of the points you've made. I've send another, more detailed, reply. I'll let you know how it goes.
    • I received a reply, too. I'm rather disturbed at how blithely the author took the my commentary though I must say that I was happy the publisher took the report seriously enough to contact the author.

      • I emailed the publisher explaining that none of the best practices that have come about in the last ten years were included in the book, etc. I got the following paraphrased response from the author:

        I am surprised and impressed that a professional PERL programmer bought my book.

        My code examples produce the correct output for the environment I specified.

        Due to space restrictions I decided not to enhance the code examples to improve security, instead I kept them short for simplicity.


        • OK, that's very interesting. You see, that's the exact same response I received. I wonder if the publisher is lying?

          I'm sorry this reader was unhappy with my PERL book. I am flattered, and a little surprised, that a professional PERL programmer is buying this book. The listed code examples produce the illustrated output in the environment described. These could be enhanced to improve security but the additional code would extend beyond the space available. The examples are kept brief for simplicity. Tha

          • Yes, that's exactly what I received. From Harshad Kotecha.

            It might not be the publisher who's lying. It might be that the author has a canned response to any criticism brought to him from someone who knows what they're talking about.

            Who knows? The response to me looked genuine enough. It's definately shoddy work to send the same response to two different letters presumably bringing up somewhat different issues!