Basic HTML version of Foils prepared April 16,1996

Foil 22 The -> Pointer Notation -- I

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


1 $LoL2D[$i][$j] can be written equivalently $LoL2D[$i]->[$j] but
2 NOT $LoL2D->[$i]->[$j] or $LoL2D->[$i][$j]
3 as left hand side of -> MUST be a reference and NOT an array or hash
4 $ref_to_LoL2D = \@LoL2D; # is allowed and now
5 access by $ref_to_LoL2D->[$i][$j] or $ref_to_LoL2D->[$i]->[$j]
6 Note [ .. ] or { .. } create anonymous arrays or hashs respectively which can be assigned to a reference and then dereferenced by ->
7 ( .. ) constructs a list which can be assigned to an Array or Hash

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