Yeah, I was thinking the same thing but I figured the smaller change would be easier to digest. However, it wouldn't be a one element hash, as I assume there will be more timestamps and we only have the beginning of the data.
EBK, if your File B ends up being much larger (say a few 10s of GB) you would want to put the first loop inside the second one so that you can read it in line by line and not waste RAM by putting the data in the hash. However for such a small file like 800 lines I don't think it is worth the effort.
Also, with this solution as someone else pointed out, if the totals are larger than the actual amount of lines of data, this will cause an undef $id and lots of warnings. I am assuming that the two files are consistent with each other.
Jim
In reply to Re^3: Perl to run 2 files and print the third with loop
by jimpudar
in thread Perl to run 2 files and print the third with loop
by EBK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |