1. The Basics of Perl

If you are experienced in other languages but new to Perl, you are probably still discovering Perl’s idiosyncrasies. This section deals with some of those idiosyncrasies. In particular, it addresses those that can bedevil newly minted Perl programmers who are still attuned to other languages.

For example, you should already know that a Perl variable is generally made up of some mark of punctuation like $ or @ followed by an identifier. But do you know whether different types of variables with the same name, such as $a and @a, are completely independent of one another? They are (see Item 5 in this chapter).

You should know that @a is an array, but do you know the difference between $a[$i] and @a[$i]? The latter is a slice ...

Get Effective Perl Programming: Ways to Write Better, More Idiomatic Perl, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.