use strict;
use warnings;
use feature 'say';
# two flat arrays would merge in @_; refs stay distinct
sub first_of_each {
my ($a, $b) = @_;
return ($a->[0], $b->[0]);
}
my @x = (1, 2, 3);
my @y = (4, 5, 6);
my ($fx, $fy) = first_of_each(\@x, \@y);
say "$fx $fy";avoid the @_ flattening trap