in reply to Confused about typeglobs and references

I wish to point out that Item 26 is really talking about two different things, and smushing them together is obscuring the important points.

First, Joe is talking about passing arguments to subroutines efficiently. That's the reason for passing them by reference. You pass in a reference, the subroutine gets a reference.

Secondly, there is the issue of accessing an array (or whatever) efficiently/conveniently, when you have a reference to it. The idea is that if you have an array-ref $a_ref, you would like to be able to access its contents as if it were not a reference but a regular array variable (e.g. @a).

The latter is achieved by assigning the reference to a typeglob.

Given

$a_ref = [ ... ]; # you can: print $a_ref->[0];
But you can access the contents of the anonymous array by giving it a name, i.e by associating it with an entry in the symbol table. That's what typeglobs are good for.
*a = $a_ref; # now you can: print $a[0];
By talking about this technique in conjunction with argument passing, it kind of obscures the essence of what's going on here.

PS - strict does not care if you use typeglobs. That is, saying

use strict; *foo = [];
will not raise an exception.
It's only when you go to use @foo (or other "normal" variable named foo) that strict will object, if the variable hasn't been declared.