in reply to variable interpolation in regexps

There is no variable interpolation in my $regexp = 'some$thing';. The content of $regex is now a literal string some$thing, since you used single quotes.

The literal string some$thing used as a regex is not equivalent to /some\$thing/, because $ is a interpreted as a regex metacharater denoting EOL. It is equivalent to /some$thing/ though, I hope the difference is obvious now.

If you wanted to interpolate $thing into $regexp, you would need to use double quotes not single quotes.
my $thing = 'THING'; my $regexp = "some$thing"; # now $regexp is 'someTHING'
Maybe the following code will illustrate it all a little better.
#!/usr/bin/perl -W use strict; my $thing1 = 'THING'; my $thing2 = '$thing'; sub test { my $regex = shift; local $_ = 'some thing someTHING some$thing'; printf " %15s =~ %s", $regex, $_; print " == TRUE , matched [", $&, "]" if /$regex/; print "\n"; } test ( 'some$thing1' ); test ( "some$thing1" ); test ( 'some$thing2' ); test ( "some$thing2" ); test ( quotemeta 'some$thing1' ); test ( quotemeta "some$thing1" ); test ( quotemeta 'some$thing2' ); test ( quotemeta "some$thing2" );