- or download this
if ($string =~ /${\(TEST)}/) {
- or download this
use constant PATTERN => qr/def/;
if ($string =~ PATTERN) { ... }
- or download this
use constant PATTERN => 'def';
my $regex = qr/${\(PATTERN)}/; #options such as /m can go here.
if ($string =~ regex) { ... }