use strict; use warnings; my @one = qw(5 6 7); my @two = qw(1 2 0); my @three = qw(1 1 1); my @four = qw(9 4 6); for my $i (0 .. $#one) { unless ($one[$i] and $two[$i] and $three[$i] and $four[$i]) { print "row $i has a zero\n"; # execute some code } }