The opening parenthesis "(" is special in regular expressions. See perlre. Most likely you want to use quotemeta before interpolating a string into a regular expression, or use \Q...\E like this:
if ($str =~ m/\Q$tr\E/) { ... };
For stylistic points, the /g on your regular expression serves no purpose.
To help us help you better, please do not vaguely rephrase Perl error messages but copy and paste the error messages.
In reply to Re: This is Strange!!! Please help me..
by Corion
in thread This is Strange!!! Please help me..
by tej
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |