Basic HTML version of Foils prepared April 16,1996

Foil 23 The -> Pointer Notation -- II

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


1 @LoL2D = ( [1,2],[1,2,3] ); # Constructs a 2D array
2 $ref_to_LoL2D = [ [1,2],[1,2,3] ]; # creates a pointer to a 2D array
3 $arraypt =\@{$LoL2D[$i]}; # extracts a slice ($i'th row) from $LoL2D[$i][$j]
4 $$arraypt->[$j] is equivalent to $LoL2D[$i][$j]
5 Perl5 is operationally like Fortran and acts as though right most elements are least significant and stored "consequitively"
6 If one has defined attributes for students with components such as $student{"grade"}
7 Then $student[$classmember]{"grade"} is way to write program to address a class of students

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