use strict; use warnings; use Devel::Peek 'Dump'; my $token = "ba\x{f1}o"; utf8::upgrade($token); Dump($token); my $term = $token; # note: i have no clue what's in $term print "match\n" if $token =~ /^$term/i; #### SV = PV(0x814d988) at 0x814d524 REFCNT = 1 FLAGS = (PADBUSY,PADMY,POK,pPOK,UTF8) PV = 0x8160848 "ba\303\261o"\0 [UTF8 "ba\x{f1}o"] CUR = 5 LEN = 6 match