Skip to Content
Beginning Perl
book

Beginning Perl

by Curtis Ovid Poe
September 2012
Beginner content levelBeginner
744 pages
15h 48m
English
Wrox
Content preview from Beginning Perl

Chapter 3

Variables

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:

  • example_3_1_variable.pl
  • example_3_2_diagnostics.pl
  • exercise_3_2a_array.pl
  • exercise_3_2b_array.pl
  • exercise_3_3_fruit.pl
  • listing_3_1_scope.pl
  • listing_3_2_vars.pl
  • listing_3_3_our.pl
  • listing_3_4_diagnostics.pl
  • listing_3_5_hello.pl

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

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Perl

Mastering Perl

brian d foy
Learning Perl 6

Learning Perl 6

brian d foy
Perl & LWP

Perl & LWP

Sean M. Burke
Perl by Example

Perl by Example

Ellie Quigley

Publisher Resources

ISBN: 9781118235638Purchase book