A variable can contain a regular expression, metacharacters and all, so you are correct about what perl is doing here: it's interpreting the dollar sign as the indicator for end-of-line.
You can get the behavior you want by using \Q (quote) and \E (end, I guess). \E is optional:
if ($after =~ /\Q$scur/){ ...
You can read more about this in perldoc perlre.
(2004-05-20 fixed typo that swapped \U for \E)In reply to Re: Regex Error
by beth
in thread Regex Error
by rjahrman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |