Basic HTML version of Foils prepared Sept 20 97

Foil 15 Hard References in Perl5 - I

From Perl5 and Advanced Perl4 Features Computational Science for Information Age Course CPS616 -- Sept 20 97. by Geoffrey C. Fox,Nancy McCracken,Tom Scavo


Hard references are more powerful than typeglobs (symbolic references) and in some cases supersede 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 Sun Apr 5 1998