Big Chemical Encyclopedia

Chemical substances, components, reactions, process design ...

Articles Figures Tables About

Arrays and Lists

Perl lists are closely related to arrays. Lists are a set of constants or variables enclosed in parentheses. An example of a list of strings would be ( one , two , buckle my shoe ), whereas an example of a list of variables would be ( a, b, c). A list that combines variables, constant strings, and constant numbers might be something like ( a, the Roman empire , 3.141592 6, ipath). Lists can be thought of as being related to array variables in the same way that the constant 123.4 might be related to the scalar variable total. [Pg.444]

Lists are useful for performing operations in parallel. For example, lists can be assigned to array variables to make the array identical to the list. In fact, one example of this was shown earlier  [Pg.444]

Arrays can be assigned to lists, provided that each element of the list is a variable and not a constant. For example, to extract the first three elements of an array, one could write [Pg.444]

After this operation, first will contain 18cl0, and so on. Naturally enough, lists can be assigned to lists as well, again provided that the list on the left contains variables only  [Pg.444]


See other pages where Arrays and Lists is mentioned: [Pg.513]    [Pg.444]   


SEARCH



© 2024 chempedia.info