in reply to Interpolation in character class

Depending on the character, you might get away with:
my $dle = sprintf "\\%03o", DLE; my $regex = "\\A[$dle][^$dle]"; $regex = qr/$regex/; if ($string =~ $regex) { ... }

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.