Without use utf8 Perl interprets your string as a sequence of single-byte characters. There are four bytes in your line:
$ perl -E 'say join ":", map { ord } split //, "鸡\n";' 233:184:161:10
The first three bytes make up your character, the last is a string.
The print call invokes these four characters in STDOUT. Your console then works on how to display these characters. If your console is configured to use UTF8, it will interpret these three bytes as your only character, and that is what is displayed.
If we add the utf8 module, everything will be different. In this case, Perl interprets your string as two characters.
$ perl -Mutf8 -E 'say join ":", map { ord } split //, "鸡\n";' 40481:10
By default, the Perl IO layer assumes that it works with single-byte characters. Therefore, when you try to print a multibyte character, Perl thinks that something is wrong and gives you a warning. As always, you can get more explanation for this error by enabling use diagnostics . He will say this:
(S utf8) Perl met a wide character (> 255) when it did not expect one. This warning is enabled by default for I / O (for example, for printing). The easiest way to calm this warning is to simply add a layer: utf8 to the output, for example. binmode STDOUT, ': utf8'. Another way to disable the warning is to not add the utf8 warning; but it is often closer to fraud. In general, you should explicitly mark filehandle with encoding, see open and perlfunc / binmode.
As others have pointed out, you need to tell Perl to accept multibyte output. There are many ways to do this (see the Perl Unicode Tutorial for some examples). One of the easiest ways is to use the -CS command line flag, which tells three standard file descriptors (STDIN, STDOUT, and STDERR) to work with UTF8.
$ perl -Mutf8 -e 'print "鸡\n";' Wide character in print at -e line 1.鸡
against
$ perl -Mutf8 -CS -e 'print "鸡\n";'鸡
Unicode is a large and complex area. As you saw, many simple programs seem to do the right thing, but for the wrong reasons. When you start correcting part of a program, the situation will often get worse until you fix the whole program.