in reply to Re: Re: XML::Simple, Switch and UTF8 errors
in thread XML::Simple, Switch and UTF8 errors

Reduced the problem to this:
$ perl -we'$x = "combo\x{fff}"; chop($x); 0 eq (~$x&$x)' Useless use of string eq in void context at -e line 1. Malformed UTF-8 character (unexpected continuation byte 0x9c, with no +preceding start byte) in bitwise and (&) at -e line 1. Malformed UTF-8 character (unexpected continuation byte 0x90, with no +preceding start byte) in bitwise and (&) at -e line 1. Malformed UTF-8 character (unexpected continuation byte 0x92, with no +preceding start byte) in bitwise and (&) at -e line 1. Malformed UTF-8 character (unexpected continuation byte 0x9d, with no +preceding start byte) in bitwise and (&) at -e line 1. Malformed UTF-8 character (unexpected continuation byte 0x90, with no +preceding start byte) in bitwise and (&) at -e line 1.
Switch.pm is using a peculiarity of ~ and & operator to see if the value is a number or a string, and it's failing when the value being switched upon has the UTF8 flag set but no characters with code points > 255.

This seems to be a bug in ~: it's returning non-UTF8 with the UTF8 flag set.

Update: This was fixed just a few days ago (see perlbug #24926).