6. References

Learning references is one of the major rites of passage in Perl. Introduced in Perl 5, references opened the way for complex data structures and object-oriented programming. References are the key to organizing data and passing it around as a unit. If you want to move to the next level in Perl, you need references.

Although this chapter shows you some reference tricks, your greatest benefit will come from your effective creation and manipulation of data structures. You’ll develop those skills with practice, so don’t be afraid to start using them.

Item 58. Understand references and reference syntax

A reference is a scalar value. You can store a reference in a scalar variable or as an element of an array or hash, just as you can ...

Get Effective Perl Programming: Ways to Write Better, More Idiomatic Perl, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.