my $regexp = 'some$thing';
the condition /$regexp/ is true if $_ contains the string 'some$thing' (because by default only one level of interpolation is performed, and thus /$regexp/ should be equivalent to /some\$thing/) - but it isn't!my $thing = 'THING';
and then tried if /$regexp/ was true for any $_ in ( 'someTHING', 'some', "some\n" ) but it still kept being false.In reply to variable interpolation in regexps by Locutus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |