in reply to Avoiding vivification with array slice
Does anyone have a nice, concise syntax for looping over "the first N elements of an array, without vivification"?
use List::Util qw(min); for my $value (@a[0 ... min($#a, $N)]) { } [download]