Basic HTML version of Foils prepared April 16,1996

Foil 15 Hard References in Perl5 - I

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


Hard References are more powerful than Typeglobs (symbolic references) and in some cases supercede them
$scalarref = \$foo; # is pointer to a scalar
$getit = $$scalarref; # is same as $getit = $foo
This is called dereferencing or going from pointer(reference) to value
$arrayref = \@array;
$hashref = \%hash;
  • used as in $$hashref{"key"} = "value";



© 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