select. Selecting elements   [3.4.6]


The method looks through the hash element by element, examining each row in respect to the specified
criterion (a mathematical expression). The elements which satisfy the criterion (returned Boolean value is "true") are added to the result hash.

Options hash can be specified:

Maximum number of rows to be selected
true=process elements in the reverse order


$thoseAbove20[^[;age]($age > 20)
[ $.limit(2) ]]

$thoseAbove20 will contain elements Stephen and Michael.

Copyright © 1997–2021 Art. Lebedev Studio | Last updated: 27.01.2021