my $regexp = quotemeta('some$thing'); ... if (/$regexp/) {