my $test="%%6ffgg"; die("illegal character found".join(',',@wrong)."\n") if @wrong = $test =~(m/([^a-zA-Z0-9])/g); output illegal character found%,%