use Algorithm::Loops qw( NestedLoops ); my @fulls = NestedLoops( [ \@areas, \@shorts ], sub { "$_[1].area$_[0]" }, );