WHAT YOU WILL LEARN IN THIS CHAPTER:
- Understanding programming in Perl
- General things to remember as you work with variables
- Understanding scalars
- Using data in arrays and hashes
- Working with array and hash slices
- Implementing scalar and list content
- Understanding the scope of variables
- Working with strict, warnings, and diagnostics
- Using Perl’s context feature
WROX.COM CODE DOWNLOADS FOR THIS CHAPTER
The wrox.com code downloads for this chapterare found at http://www.wrox.com/WileyCDA/WroxTitle/Beginning-Perl.productCd-1118013847,descCd-DOWNLOAD.html on the Download Code tab. The code for this chapter is divided into the following major examples:
This chapter examines the three primary data types of Perl: scalars, arrays, and hashes. Unlike many other languages that focus on things such as strings, integers, floats, and so on, Perl’s types focus on how you organize your data, rather than what the data is. It’s an approach to data types that is unusual to those who think of “types” as restricting data to certain values, but in practice, it’s a robust, powerful approach that many other programming languages follow.
Don’t worry about the size of this chapter because you won’t need to memorize it. Most of this information will be reinforced ...