$ perl -e "$x=$_='()';print/^\Q$x\E$/?YES:NO" YES $ perl -e "$x=$_='()';print/^\Q$x$/?YES:NO" NO