use charnames ":full"; BEGIN{ my $s = $^H{charnames}; $^H{charnames} = sub { $_[0] =~ /^\$(.*)/s ? &$s($$1) : &$s; } } BEGIN { $name = "LATIN SMALL LETTER P"; } print "j\N{LATIN SMALL LETTER A}\N{$name}h\n"