in reply to Re^3: How to add values of hash by reading from different text files
in thread How to add values of hash by reading from different text files
That being said, you can drop all the my keywords in my program and if you also delete the use strict; it will still run fine, but you really, really should look into the use of my (and use strict;). It wil save you a lot of time and effort over and over again and will guard against stupid and silly mistakes.
The way my program is written, it will always only read one line of the file in memory at any time, so your files can actually have millions of lines and it will still work.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|