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