in reply to Re: Capturing occurrence counts via tr/// with variable interpolation
in thread Capturing occurrence counts via tr/// with variable interpolation

Better to just use \Q\E:
$ans = eval "\$str =~ y/\Q$SrchStr\E//";
  • Comment on Re^2: Capturing occurrence counts via tr/// with variable interpolation
  • Download Code