$ perl -Mstrict -Mwarnings -E ' > my $x = q{X-X!X?X}; > $x =~ s/([[:^upper:]])/unpack q{H2}, $1/eg; > say $x; > ' X2dX21X3fX