in reply to array testing
If that's too obfu for your tastes, dissect it from the inside out and write explicit loops. The grep is going through the list of references to arrays and returning only the ones for which the array has elements. The map is then turning each array into a string of comma-separated values via join, and the top join is putting all those strings together with " and "s.my $test = join(' and ', map { join(',', @$_) } grep(@$_, \@a, \@b, \@c, \@d, \@e, \@f, \@g));
|
|---|