Basically, doing *alias = \$name makes $alias and $name the same thing. Thus, doing *alias = \*name is making all things with a symbol name 'alias' the same thing as those with the name 'name' (in some specific package, let's say main::).
The wonderful thing about globs is that they can be used where references are expected: @{ *foo } is like @{ \@foo }. Thus, you can use a glob where you would ordinarily use a reference to a glob. That means that you can say *alias = *name instead of *alias = \*name.
Another reason that *alias = *name works the same way as *alias = \*name is because you can assign a string to a typeglob:
So, since a glob in scalar context is its "name", you can assign that name to a glob.*foo = "bar"; print *foo; # *main::bar *foo = "this::that"; print *foo; # *this::that
P.S. You can't say \*alias = ..., since you can't assign to a reference of something (that's why \$foo = \$bar doesn't work).
japhy --
Perl and Regex Hacker
In reply to Re: Taken out of Context
by japhy
in thread Taken out of Context
by Petruchio
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |