use utf8; binmode(STDIN,":utf8"); $x=<>; chomp $x; use bytes; print length($x);