Next: Numeric Literals
Up: Practical Perl Programming
Previous: Further Reading/Information
In this chapter, we willl take a look at some of the ways that Perl
handles data. All computer programs use data in some way. Some
use it to personalize the program. For example, a mail program
might need to remember your name so that it can greet you upon
starting. Another program-say one that searches your hard disk
for files-might remember your last search parameters in case you
want to perform the same search twice.
A literal is a value that is represented "as is"
or hard-coded in your source code. When you see the four characters
45.5 in programs it really refers to a value of forty-five and
a half. Perl uses four types of literals. Here is a quick glimpse
at them:
- Numbers - This is the most basic data type.
- Strings - A string is a series of characters that are handled
as one unit.
- Arrays - An array is a series of numbers and strings handled
as a unit. You can also think of an array as a list.
- Associative Arrays - This is the most complicated data type.
Think of it as a list in which every value has an associated lookup
item.
Arrays will be discussed in Chapter 4
Numbers and strings will be discussed in the
following sections.
Next: Numeric Literals
Up: Practical Perl Programming
Previous: Further Reading/Information
dave@cs.cf.ac.uk