Perl makes it easy to get a character.
$ perl -CO -E 'say "\N{FAMILY}"'
👪
Is there a way to evaluate a character using "\N{}"interpolation? Something like:
perl -CO -E 'my $what = "FAMILY"; say "\N{$what}"'
(which doesn't work, but gives you a taste).
Besides feasibility, is there any flaw or possible threat to such an assessment? For instance. let's say the string $whatis user defined, I would never eval $what. Safe I \N{$what}?
Oops ...
After receiving the answers, I noticed how this information is clearly indicated in perlunicook. Sorry for the lack of RTFM. I think this is good if you use stackoverflow anyway.
Dacav source
share