in reply to Analysing text files to obtain statistics on their content.
As to the matter of style, I can strongly recommend to properly indent your code, one tab (or 4 or 8 spaces or whatever) per opening bracket. That way you'll actually see what it's doing.
Secondly I suggest you use lexical variables as file handles, and use the three-argument for of open. See perlopentut for more details.
See perlstyle for more tips on how to make your code readable.
If you want more in-depth analysis of your script, install Perl::Critic, it might give you some helpful at wise.
Now I can only recommend that you read Writeup Formatting Tips and update your posting to use paragraphs for text, and code tags only for code.
Helping with homework isn't much fun, btw.
|
|---|