Perl v5.26 updates itself to Unicode 9. That’s not normally exciting news but people have been pretty enthusiastic about the 72 new emojis that come. As far as Perl cares, they are just valid code points like all of the other ones.

I went to Emojipedia to see what I could do. I’d already used the 🦋 in Learning Perl 6, although 🦖 would be more appropriate here. I was curious where these new emojis are in the UCD.

First, how many new characters show up in Unicode 9? I could look this up but it’s easier and more fun to do it in Perl:

my $count = 0; foreach ( 0 .. 0x10FFFF ) { my $char = chr; next if $char =~ /\p{Present_In: 8.0}/; next if $char =~ /\p{Unassigned}/; $count++; } say "There are $count new chars";

This skips anything that was present in the previous version (8.0) and then any code points that are not assigned. This gives exactly 7,500:

There are 7500 new chars

What are those other 7,428 characters? You could figure that out just as quickly. But who cares? They aren’t emojis.

The 72 new emojis are listed on Emojipedia, so you can use Mojo::UserAgent to grab those. Since these are certainly wide characters you have to do some extra setup (see the “Unicode Primer” chapter in Learning Perl or the various perluni* docs):

use v5.26; use utf8; use strict; use warnings; use open qw(:std :utf8); use charnames qw(); use Mojo::UserAgent; my $ua = Mojo::UserAgent->new; my $url = 'https://blog.emojipedia.org/new-unicode-9-emojis/'; my $tx = $ua->get( $url ); die "That didn't work!

" unless $tx->success; say $tx->result ->dom ->find( 'ul:not( [class] ) li a' ) ->map( 'text' ) ->map( sub { my $c = substr $_, 0, 1; [ $c, ord($c), charnames::viacode( ord($c) ) ] }) ->sort( sub { $a->[1] <=> $b->[1] } ) ->map( sub { sprintf '%s (U+%05X) %s', $_->@* } ) ->join( "

" );

From this I see the list of new emoji are not contiguous:

🕺 (U+1F57A) MAN DANCING 🖤 (U+1F5A4) BLACK HEART 🛑 (U+1F6D1) OCTAGONAL SIGN 🛒 (U+1F6D2) SHOPPING TROLLEY 🛴 (U+1F6F4) SCOOTER 🛵 (U+1F6F5) MOTOR SCOOTER 🛶 (U+1F6F6) CANOE 🤙 (U+1F919) CALL ME HAND 🤚 (U+1F91A) RAISED BACK OF HAND 🤛 (U+1F91B) LEFT-FACING FIST 🤜 (U+1F91C) RIGHT-FACING FIST 🤝 (U+1F91D) HANDSHAKE 🤞 (U+1F91E) HAND WITH INDEX AND MIDDLE FINGERS CROSSED 🤠 (U+1F920) FACE WITH COWBOY HAT 🤡 (U+1F921) CLOWN FACE 🤢 (U+1F922) NAUSEATED FACE 🤣 (U+1F923) ROLLING ON THE FLOOR LAUGHING 🤤 (U+1F924) DROOLING FACE 🤥 (U+1F925) LYING FACE 🤦 (U+1F926) FACE PALM 🤧 (U+1F927) SNEEZING FACE 🤰 (U+1F930) PREGNANT WOMAN 🤳 (U+1F933) SELFIE 🤴 (U+1F934) PRINCE 🤵 (U+1F935) MAN IN TUXEDO 🤶 (U+1F936) MOTHER CHRISTMAS 🤷 (U+1F937) SHRUG 🤸 (U+1F938) PERSON DOING CARTWHEEL 🤹 (U+1F939) JUGGLING 🤺 (U+1F93A) FENCER 🤼 (U+1F93C) WRESTLERS 🤽 (U+1F93D) WATER POLO 🤾 (U+1F93E) HANDBALL 🥀 (U+1F940) WILTED FLOWER 🥁 (U+1F941) DRUM WITH DRUMSTICKS 🥂 (U+1F942) CLINKING GLASSES 🥃 (U+1F943) TUMBLER GLASS 🥄 (U+1F944) SPOON 🥅 (U+1F945) GOAL NET 🥇 (U+1F947) FIRST PLACE MEDAL 🥈 (U+1F948) SECOND PLACE MEDAL 🥉 (U+1F949) THIRD PLACE MEDAL 🥊 (U+1F94A) BOXING GLOVE 🥋 (U+1F94B) MARTIAL ARTS UNIFORM 🥐 (U+1F950) CROISSANT 🥑 (U+1F951) AVOCADO 🥒 (U+1F952) CUCUMBER 🥓 (U+1F953) BACON 🥔 (U+1F954) POTATO 🥕 (U+1F955) CARROT 🥖 (U+1F956) BAGUETTE BREAD 🥗 (U+1F957) GREEN SALAD 🥘 (U+1F958) SHALLOW PAN OF FOOD 🥙 (U+1F959) STUFFED FLATBREAD 🥚 (U+1F95A) EGG 🥛 (U+1F95B) GLASS OF MILK 🥜 (U+1F95C) PEANUTS 🥝 (U+1F95D) KIWIFRUIT 🥞 (U+1F95E) PANCAKES 🦅 (U+1F985) EAGLE 🦆 (U+1F986) DUCK 🦇 (U+1F987) BAT 🦈 (U+1F988) SHARK 🦉 (U+1F989) OWL 🦊 (U+1F98A) FOX FACE 🦋 (U+1F98B) BUTTERFLY 🦌 (U+1F98C) DEER 🦍 (U+1F98D) GORILLA 🦎 (U+1F98E) LIZARD 🦏 (U+1F98F) RHINOCEROS 🦐 (U+1F990) SHRIMP 🦑 (U+1F991) SQUID

Things to remember