Using References with Subroutine Arguments and Return Values
So far, you've got a basic idea of how references work. There's still lots more detail to explain about creating and using references, but let's stop for a moment and do something practical. On Day 11, “Creating and Using Subroutines,” when we talked about sub- routines, I mentioned that lists and subroutines tend to be somewhat awkward without references. Let's revisit that topic and explore how references can make subroutine list arguments and return values much easier to manage.
As you already know, Perl has a very basic capability to pass arguments into and out of subroutines. All list arguments into a subroutine are flattened into a single list and stored in ...