I have a string which may hold special characters like: $
, (
, @
, #,
etc.
I need to be able to perform regular expressions on that string.
Right now if my string has any of these characters the regex seems to break since these are reserved characters for regex.
Does anybody knows a good subroutine that would escape nicely any of these characters for me so that later I could do something like:
$p_id =~ /^$key/