in reply to Interpolation in character class

They are interpolated. To make sure it always works, don't forget to quotemeta the DLE.
use constant DLE => chr(0x10); my $rx = do { local $_ = quotemeta DLE; qr/ \A $_ [^$_] /x }; $msg =~ $rx;

Makeshifts last the longest.