next up previous contents
Next: Numeric Literals Up: Practical Perl Programming Previous: Further Reading/Information

Numeric and String Literals

  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:

Arrays will be discussed in Chapter 4 Numbers and strings will be discussed in the following sections.



 
next up previous contents
Next: Numeric Literals Up: Practical Perl Programming Previous: Further Reading/Information
dave@cs.cf.ac.uk