Understanding references is vital to work with complex data structures; that's the reason for this short introduction.

A reference is basically a pointer to another object. It's as simple as that.

A very important fact is that these pointers are stored in scalar variables. As hashes and arrays are basically collections of scalar variables, you can have array or hash elements that are in fact references to other structures; this way you can easily construct structures like array of arrays, array of hashes, etc.