in reply to Array elements in groups of 20

Use a slice, for example:
@array[0..19]
You were almost there. The sigil $ on an array indicates that a scalar index is inside the [], an @ indicates a list of indexes is inside the [] (same applies to hashes and {}). So you needed the @.