#!/bin/env perl use constant REGEX => qr/cat/; my $s = 'The cat in the hat...'; if ($s =~ /REGEX/) { print "found\n"; } else { print "not found\n"; }