Introduction to references

Perl's basic data type is the scalar. Arrays and hashes are made up of scalars, in one- or two-dimensional lists. It is not possible for an array or hash to be a member of another array or hash under normal circumstances.

However, there is one thing about an array or hash which is scalar in nature -- its memory address. This memory address can be used as an item in an array or list, and the data extracted by looking at what's stored at that address. This is what a reference is.

References are covered in detail in chapter 4 of the Camel book, and in perldoc perlref. Chapter 1 of Advanced Perl Programming (O'Reilly's Panther book) contains a very good explanation of references. Lastly, Tom Christiansen's FMTEYEWTK (Far More Than You Ever Wanted To Know) tutorials contain information about references. They're available from the Perl website