use Smart::Match 'all'; if ( 0 ~~ all(@array[0,1]) ) { say 'matched'; } #### if @array[0 & 1] == 0 { say 'matched'; }