Typeglobs assignment aliases identifiers. In the following example, all identifiers named a (scalar, array, hash, subroutine, filehandle, format) are also available as b:
*a = *b ; # Alias
$b = 10; # Same as modifying $a
b(); # Same as calling a()
*a = \$b ; # Only $a aliased to $b
*a = \10; # Alias a typeglob to a reference to a constant
$a = 20; # Run-time error - "Attempt to modify read-only variable"
[ Library Home | Perl in a Nutshell | Learning Perl | Learning Perl on Win32 | Programming Perl | Advanced Perl Programming | Perl Cookbook ]