The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
use strict;
use warnings;
use utf8;
use Test::More tests => 2;
use Unicode::Util qw( graph_chop code_chop );

my $grapheme = "x\x{44E}\x{301}";  # xю́

is graph_chop($grapheme), 'x', 'graph_chop returns all but the last grapheme';
is code_chop($grapheme), "x\x{44E}", 'code_chop returns all but the last codepoint';