O'Reilly logo

Effective Perl Programming: Ways to Write Better, More Idiomatic Perl, Second Edition by brian d foy, Joshua A. McAdams, Joseph N. Hall

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required