$folder = $entryfolder->get();#get the value from the entry widget my @chars = split //,$folder; foreach (@chars){ if($_ eq "*" || $_ eq '$' || $_ eq "&" || $_ eq "." || $_ eq "?" || $_ eq '\'){ $dialog = $sw-> Dialog( -title=> 'Alert', -text => "Special characters appear in the name of your folder.", -buttons => [ qw(OK) ]) ->Show(); } }