my $mode = $cw->cget('-validate'); if (defined $mode && $mode =~ /match/) { # <== change $cw->configure(-validate => 'none'); }