In a world of many
@choices
With a$limitto what one can do,
Life proposes many@options
But at time
@choices = @options; splice @choices, $limit; # "splice() offset past end" before v5.16
It can also be done in a single statement!
@choices = splice @{[@options]}, 0, $limit;
And also
splice @{$choices_ref=[@options]}, $limit; # Warns "splice() offset past end" before v5.16
splice $choices_ref=[@options], $limit; # Ditto. Requires Perl v5.14. "Experimental"