Just another Perl shrine | |
PerlMonks |
Re: update flat fileby dvergin (Monsignor) |
on Jan 13, 2003 at 06:28 UTC ( [id://226409]=note: print w/replies, xml ) | Need Help?? |
Indenting is a wonderful tool for making it much easier to see what is happening in a piece of code. It is a standard practice among folks who want to get a quick visual grasp of the over-all flow of their code. Here is your program with indenting added:
Notice how much more clear the logic of your code becomes when formatted in this way? Moving on... you do not describe what result you are getting (beyond saying "it is not working"). But as you can see, every time through the while (<FILEB>) loop you are re-writing a new A.txt.new over the top of the one you wrote on the previous time through the loop. Does that shed any light on the unsatisfactory results you are getting? There are other issues with this code and you may soon see a full re-write of your program posted here. But I suspect this is the main issue at this stage in your work. UpdateAcidHawk correctly nails several other specific problems. Much of what he calls attention to should have been evident from the error messages produced by your code. Next time, please say more than just "it is not working".
In Section
Seekers of Perl Wisdom
|
|