my $regexp = qr/\Qsome$thing\E/; ... if (/$regexp/) { #### my $regexp = quotemeta('some$thing'); ... if (/$regexp/) {