in reply to Whats wrong in this code?

Your description is unclear, do you want to count the lines starting with > ?

that's what your regex does, its not counting all > in the file.

Debugging hints :

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!