Basic HTML version of Foils prepared
March 30 97
Foil 20 Arrays and Lists of Scalars(data) V -- Element Access (Chapter 3 of Llama Book)
From
PERL4 Tutorial for CPS616 Computational Science for Information Age Course CPS616 --
February 1995
.
by
Geoffrey C. Fox
1
One can use slices as in Fortran90
@fred= (0..10); # defines an array with 11 entries and
@jeff = @fred[1,3]; # creates an array @jeff = (1,2,3);
2
Indices can (of course) be expressions as in most languages and these can be any legal scalar
@fred = (0..10); $a=2;
$b= $fred[$a-1]; # sets $b equal to 1
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