for (0 .. 2) { my $output = qx{echo '\$_ is $_'}; print $output; } #### my @things; for (0 .. 2) { my @inv = ...; my @outv = ...; push @things, [ \@inv, \@outv ]; }