Embedding literal strings in Perl source code is easy. Use the utf8
pragma. (Do not use the encoding
pragma, it is highly problematic.)
use utf8;
my $perl_string = '你好,张HY';
Your text editor must save this file as UTF-8, too.
Then, if you want to output Perl strings, you must encode them first, see perlunitut and perlunifaq.
use Encode qw(encode);
use Encode::HanExtra;
# for example, printing to STDOUT
print encode('UTF-8', $perl_string); # in a Linux environment
print encode('GB18030', $perl_string); # in a Windows environment
I also want to advise you that since the year 2006 support for the national standard GB18030 is mandatory for all software products in the PRC - you have to install Encode::HanExtra from CPAN.