--- In perl-beginner%40yahoogroups.com">perl-beginner
yahoogroups.com, "yaswanth krishna"
<yaswanth.krishna
...> wrote:
>
> Hi..
>
> I had a problem while using regex containing scalar
variable(consisting of
> one paranthesis)..
> Can anyone tell me how to handle this..
>
> It is considering that paranthesis as closing paranthesis for "if
> condition".
>
> >perl -e '$a = "asdasd)"; $b =asda; if( $b =~ /$/ ){ print
> "matchn"; }'
> /asdasd)/: unmatched () in regexp at -e line 1.
>
> Is there any option while matching regex to consider metacharacters as
> normal characters..
>
>
> Thanks
> Krishna..
>
>
> [Non-text portions of this message have been removed]
>
yes just escape them with a back slash , thus to check for ")" use ")"
if( $b =~ /$)/ ) { print etc...}
Greg
.