redo if ( @gArray && grep { /$rInt/ } @gArray ); ... redo if ( @mArray && map { /$rInt/ } @mArray ); ... redo if ( @sArray && $rInt ~~ @sArray );