12.1. Tips for Everyman

You need to make certain adjustments when coming to Perl from more familiar languages:

  • Variables begin with type-specifying punctuation characters[1] referred to by some as sigils. It's not quite the revenge of Hungarian notation—no mblock *apmblkMessages[] here, thank goodness. The hardest thing for a Perl beginner to assimilate is that while, for example, @animals is the name of an array, $animals[14] is the name of a particular element in it, and @animals[2..7] is the name of a slice of that array. Just remember the rule that when you're referring to exactly one thing, it's a scalar and therefore begins with a $, whereas multiple things are an array—sort of—and begin with an @ sign.

    [1] Well, most of them. Filehandles ...

Get Perl Debugged now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.