Basic HTML version of Foils prepared
Sept 20 97
Foil 19 Arrays and Lists of Scalars II -- Construction
From
Tutorial on PERL Computational Science for Information Age Course CPS616 --
Sept 20 97
.
by
Geoffrey C. Fox,Nancy McCracken,Tom Scavo
There is a list construction operator .. which provides a list of values incremented by 1
@fred = (1..4); # is list (1,2,3,4) and
@fred = (2,3, $a..$b); # CURRENT values of $a, $b
@jeff = @fred[1..3]; # creates an array @jeff = (1,2,3);
We can also use assignment operator = in flexible ways
@fred = @jeff; # sets two lists equal to each other while
@fred= (4,5,@jeff); # defines a list @fred with two more entries than @jeff
©
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 Sep 21 1997