Basic HTML version of Foils prepared April 16,1996

Foil 13 Soft Symbol Table References - I

From Perl5 and Advanced Perl4 Features Computational Science for Information Age Course CPS616 Material -- April 16,1996. by Geoffrey C. Fox


One of Perl's "problems" (also its strength if you are knowledgeable) is that one often needs to understand implementation issues to use effectively
Every package has a symbol table (i.e. list of used symbols) called :: so that main symbol table is
%main:: and variable $var in main has symbol table entry $main::{'var'}
*var is equivalent to $main::{'var'}
The symbol $original exists, we can set
*var = *original; # and then $var is another 'name' for $original and @var is separately another name for @original etc.
  • i.e. $var @var %var have same symbol table entry but will have different hard references



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Sep 6 1997