When it gets to an invalid non-UTF8 character the message "Malformed UTF-8 character (byte0xff) in pattern match (m//) ... , but the match does not fail and $& holds the bad characters plus some subsequent bytes. How can I get the match to fail so I can remove the first char in the buffer.use utf8; $read_buf =~ m/^\W/; $utf8_char = $&;
In reply to UTF8 matches by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |