Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^2: comparing file contentsby kumaar1986 (Initiate) |
on Nov 23, 2011 at 01:27 UTC ( [id://939573]=note: print w/replies, xml ) | Need Help?? |
This looks confused. print IN $anything_at_all will write to the IN file. Are you trying to overwrite the data in 'female1.txt'? Luckily, Perl will not let you, because you opened the file as read-only. Your original description says "...should be replaced with ICD-code files corresponding...", but you are not outputting the entire line. Is the '>>' a debugging marker, or does it indicate that you are trying to append to a file? Going by your original description, I think you need: I need to overwrite the result in 'female1.txt' instead of writing in a new output file .can that be achieved by changing the 'female1.txt' in to read and write mode print {$out_fh} join( ' ', @cols ), "\n"to print {$in_path} join( ' ', @cols ), "\n"Let me know if there is any other way to do this. thanks for your help in advance. your explanations are really good. I appreciate your time and effort for helping
In Section
Seekers of Perl Wisdom
|
|