use constant REGEXP => qr(a); print grep { REGEXP } qw(a b c);