Chap. 3: Lists and Arrays 1. What is the term for an 'ordered collection of scalars' in P6? 2. What kind of variable holds an ordered collection of scalars in P6? 3. Are there restrictions on what lists or arrays can hold in P6? 4. How do I access elements of an array in P6? * What sigils are used on arrays and on elements of arrays? * How do I access elements at the end of arrays? * Is there a variable for the number of elements in an array or for the highest index number in an array? 5. Does P6 have 'list literals'? 6. Does P6 have range operator(s)? 7. Does P6 have shortcuts for 'whitespace-quoting' the elements of a list? * If so, what characters can be used as delimiters? 8. How do I assign values to a list or an array in P6? * How do I copy one array to another in P6? 9. What operators are available in P6 for manipulating lists? * How do I take the last element off an array and return it? * How do I add an element to the end of an array? * How do I take the first element off an array and return it? * How do I add an element to the beginning of an array? 10. Can I interpolate an array into a double-quoted string? 11. What control structure(s) does P6 have a for iterating over the elements of a list? 12. Does P6 have a topic variable or a common default variable? 13. In what ways can I reverse the order of a list's elements in P6? 14. In what ways can I sort the elements of a list in P6? 15. What different contexts for expectations of values does P6 have? * How do expressions which typically produce lists behave in contexts where a scalar is expected? * example: 'reverse' * How do expressions which typically produce scalars behave in contexts where a list is expected? * Is the result automatically promoted to a one-element list? * Can I force scalar context on an expression? * Can I force list context on an expression? 16. How does the line-input operator behave in list context? Exercises: Learning Perl, 4th ed., p. 52 # vim: textwidth=100: