my @things; for (0 .. 2) { my @inv = ...; my @outv = ...; push @things, [ \@inv, \@outv ]; }