# make sure that strings coming from STDIN are decoded: binmode STDIN, ':encoding(UTF-8)'; # make sure that strings written to STDOUT are encoded: binmode STDOUT, ':encoding(UTF-8)'; my $line = ; $line = ucfirst $line; print $line;