for my $lhs (@array1) { ... for my $rhs (@array2) { lcssw($lhs, $rhs); ... } }