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


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

in Table To:


© 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