print "\@arr1 has both" if grep {$_ eq "Sun"} @arr1 and grep {$_ eq "Moon"} @arr1;