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


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