use String::Approx 'amatch'; $match = amatch(@txt1, @txt2));