in reply to Perl Gotchas.

Perl's error messages suck. You get used to it after a while. use diagnostics can sometimes help. Just remember that the line reported in the error may not be the line that is actually causing a problem. This isn't a problem specific to Perl (I've heard stories of people getting hundreds of error messages from a C compiler due to a single missing semicolon), but it tends to happen more often in Perl compared to other languages.

The reported error may have occured on that line or at some earlier point in the same block. I doubt that the error would have started outside the enclosing block, but I'm ready to be proven wrong on this.

what other perl gotchas are there out there that could bite me?

How many angels can dance on the head of a pin?

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

: () { :|:& };:

Note: All code is untested, unless otherwise stated

Replies are listed 'Best First'.
Re: Re: Perl Gotchas.
by pg (Canon) on Nov 20, 2003 at 17:45 UTC
    "Perl's error messages suck."

    In this case, it sucks, but in general, I feel the opposite ;-) According to my own experience up to this point, Perl’s debug information meets my everyday needs.

Re: Re: Perl Gotchas.
by rob_au (Abbot) on Nov 21, 2003 at 00:35 UTC
    Perl's error messages suck.

    I have to admit though, every time I get a Segmentation Fault from some obtuse bug in our C codebase, I wish for Perl-type error reporting.

    :-)

     

    perl -le "print+unpack'N',pack'B32','00000000000000000000001010010001'"