use open IO => ':utf8', ':std'; [download]
The order matters.
In reply to Re^3: length() miscounting UTF8 characters? by choroba in thread length() miscounting UTF8 characters? by Anonymous Monk