introduction to Perl 5 for web developers References References came about mainly because traditionally, Perl had a limited range of data structures with which to manipulate data

Specifically, Perl supported simple, linear data structures like list arrays, scalars, and hashes. For most of the daily chores of programming, of course, this was enough.

However, from time to time, one might need to use a more complex data structure like perhaps an array of arrays. Well, complex data structure manipulation in Perl turned out to be quite a pain in the butt. So when Perl 5 came around, everyone was pleased to see the adoption of "references" which were roughly similar to pointers from C or C++ and could be used to help construct complex data structures.

Essentially, a reference holds a scalar value representation of some portion in memory where some other Perl objectís (scalars, arrays, hashes, subroutines, etc) value is stored. Take a look at this depicted graphically:

[Reference Diagram]

As we discuss the syntax of references in the following slides, we will begin to see how this simple idea has powerful ramifications.

Previous | Next | Table of Contents