Basic HTML version of Foils prepared Sept 20 97

Foil 20 Implementation Issues - 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


All multi-dimensional data structures are implemented as arrays of references
for $i (1..10) {
@list = somefunc($i); # grab a list labelled by $i
# Compute the number of elements in @list:
$LoL[$i] = scalar @list;
# Create a fresh 2D array for each $i:
$LoL2D[$i] = [ @list ]; # use array constructor [ ]
} # End for loop
my(@list) = somefunc($i); # my() creates a fresh instance each time
$LoL2D[$i] = \@list; # also works but is perhaps less clear



© 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