in reply to Count word in my dir

The reason it isn't working is that you aren't opening the files. Readir returns a list of filenames. You have to open and read from each of the files.
I'm assuming you are the poster of an almost identical question earlier today. The answer to this question is in the replies to the last question.
Also, you are coding without strict or warnings. You cannot expect to learn to write good Perl code without them.


-pete
"Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."