in reply to Whats wrong in this code?
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!