Basic HTML version of Foils prepared Sept 20 97

Foil 23 The -> Pointer Notation -- II

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


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



© 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