my @tmp=split/$separator/; # e.g. , or | is the separator my $last=pop @tmp; # get the last element $last=$s/\s+//g; #clean it up #normally $last would be a number. If it is not a number but a unicode # string, I want to throw an exception. The problem # is that I get a fatal malformed Utf-8 character error when I try either if($last !~/\d/){...} or if($last=~/[^/x00-\x7f]){...}