http://www.perlmonks.org?node_id=885960


in reply to Re: Regexp \N{name} (use of \e)

#!/opt/perl/bin/perl use strict; use warnings; use charnames ':full'; binmode STDOUT, ":utf8"; my $string = ':)'; print "$string becomes: "; $string =~ s/:\)/\N{WHITE SMILING FACE}/; print "$string\n$string becomes: "; $string =~ s/\N{WHITE SMILING FACE}/\N{BLACK SMILING FACE}/; print "$string\n$string becomes: "; $string =~s/\N{BLACK SMILING FACE}/:\)/; print "$string\n";

That should cover most uses of \N{CHARNAME}.

charnames and perlre are the best references.

Update: added #! to example