Day 19. Working with References

For the last several chapters, we've been looking at a number of aspects of Perl that you might consider auxiliary to the core language itself. For instance, working with various functions in the standard library for managing filesystems or processes, importing code from modules, and then using those modules to accomplish various tasks, or working with the Perl debugger. Today, as we reach the final few lessons in this book, we'll return to the core language with a discussion of references. References are a way of indirectly pointing to other bits of data in Perl. They allow you to manage data in more advanced and often more efficient ways than handling the data itself. In today's lesson, we'll explore these topics:

  • What references are, and the advantages they give you

  • Creating and using references to scalars, arrays, and hashes

  • Using references in subroutines for arguments and return values

  • Creating nested data structures (multidimensional arrays, arrays of hashes, and so on)

  • Clever ways to avoid using references

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset