use strict; use warnings; use List::MoreUtils qw/ true /; my @lists = ( [ 1, 0, 1 ], [ 1, 0, 0 ], [ 1, 1, 1 ], [ 0, 0, 0 ] ); foreach my $aref ( @lists ) { print "Testing @{$aref}\n"; print "Total list Exclusive OR ", ( 1 == true { $_ } @{ $aref } ) ? '' : 'not ', "satisfied.\n\n"; }