in reply to Counting the number of replaces

rsriram, please read How do I post a question effectively?. Your could have found the answer for your last questions by yourself, skimming through perfunc (perl function reference) and perlop (perl operator reference).

cheers,
--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}